[jbosstools-commits] JBoss Tools SVN: r42140 - in trunk/hibernatetools: plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal and 24 other directories.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Thu Jun 21 08:05:06 EDT 2012


Author: dgeraskov
Date: 2012-06-21 08:05:03 -0400 (Thu, 21 Jun 2012)
New Revision: 42140

Added:
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/GenericGeneratorAnnotationDefinition.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/GenericGeneratorsAnnotationDefinition.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/TypeDefAnnotationDefinition.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/TypeDefsAnnotationDefinition.java
Removed:
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/GenericGeneratorsAnnotation.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateNamedNativeQueriesAnnotation.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateNamedQueriesAnnotation.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateSourceNamedNativeQueriesAnnotation.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateSourceNamedQueriesAnnotation.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/NestableParameterAnnotation.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/SourceGenericGeneratorsAnnotation.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/TypeDefsAnnotation.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/TypeDefsAnnotationImpl.java
Modified:
   trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/properties/HibernatePropertyPage.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateAbstractJpaFactory.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJpaAnnotationDefinitionProvider.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJpaPlatform.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJpaPlatformFactory.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJpaProject.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJptPlugin.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/JavaPackageInfoResourceModelProviderPatched.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/HibernateGeneratorContainer.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/HibernatePersistenceUnit.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/NamingStrategyMappingTools.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/definition/HibernateJavaBasicMappingDefinition.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/definition/HibernateJavaEntityDefinition.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/definition/HibernateJavaIdMappingDefinition.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/definition/HibernateJavaManyToManyMappingDefinition.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/definition/HibernateJavaManyToOneMappingDefinition.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/definition/HibernateJavaOneToManyMappingDefinition.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/definition/HibernateJavaOneToOneMappingDefinition.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/AbstractHibernateNamedQueryImpl.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/ForeignKeyAnnotation.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaBasicMappingImpl.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaDiscriminatorColumnImpl.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaEntity.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaEntityImpl.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaGeneratorContainer.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaGeneratorContainerImpl.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaIdMappingImpl.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaJoinColumnImpl.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaJoinColumnJoiningStrategy.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaJoinColumnRelationshipStrategy.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaManyToManyMapping.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaManyToManyRelationship.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaManyToManyRelationshipReference.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaManyToOneMapping.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaManyToOneRelationship.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaManyToOneRelationshipReference.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaOneToManyMapping.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaOneToManyRelationship.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaOneToManyRelationshipReference.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaOneToOneMapping.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaOneToOneRelationship.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaQueryContainer.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaQueryContainerImpl.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaTypeDefContainer.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaTypeDefContainerImpl.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateNamedNativeQueryImpl.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateNamedQueryImpl.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernatePackageInfo.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernatePackageInfoImpl.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/JavaGenericGeneratorImpl.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/JavaPackageInfo.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/JavaTypeConverter.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/JavaTypeConverterImpl.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/JavaTypeDefImpl.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/TypeImpl.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/jpa2/HibernateJavaElementCollectionMapping2_0.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/orm/HibernateOrmBasicMapping.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/orm/HibernateOrmEntityImpl.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/orm/HibernateOrmIdMappingImpl.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/orm/HibernateOrmJoinColumnImpl.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/orm/HibernateOrmManyToManyRelationshipReference.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/orm/HibernateOrmManyToOneRelationshipReference.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/orm/HibernateOrmOneToManyRelationshipReference.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/orm/HibernateOrmOneToOneRelationshipReference.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/orm/HibernateOrmXmlContextNodeFactory.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/orm/jpa2/HibernateOrmXml2_0ContextNodeFactory.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/persistence/HibernateClassRef.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/jpa2/HibernateJpa2_0AnnotationDefinitionProvider.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/jpa2/HibernateJpa2_0PlatformFactory.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/jpa2/HibernateJpaFactory2_0.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/jpa2/context/definition/HibernateJavaManyToManyMappingDefinition2_0.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/DiscriminatorFormulaAnnotation.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/DiscriminatorFormulaAnnotationImpl.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/ForeignKeyAnnotationImpl.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/GeneratedAnnotation.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/GeneratedAnnotationImpl.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/GenericGeneratorAnnotation.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/GenericGeneratorAnnotationImpl.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateNamedNativeQueriesAnnotationDefinition.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateNamedNativeQueryAnnotation.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateNamedNativeQueryAnnotationDefinition.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateNamedQueriesAnnotationDefinition.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateNamedQueryAnnotation.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateNamedQueryAnnotationDefinition.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateQueryAnnotation.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateSourceNamedNativeQueryAnnotation.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateSourceNamedQueryAnnotation.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/IndexAnnotation.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/IndexAnnotationImpl.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/ParameterAnnotation.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/SourceParameterAnnotation.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/TypeAnnotation.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/TypeAnnotationImpl.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/TypeDefAnnotation.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/TypeDefAnnotationImpl.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/validation/HibernateJpaValidationMessage.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/HibernateJpaPlatformUiProvider.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/details/HibernateTableComposite.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/details/PackageInfoDetailsPage.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/details/java/JavaPackageInfoDetailsProvider.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/jpa2/details/HibernateElementCollectionMapping2_0Composite.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/jpa2/mapping/details/orm/Hibernate2_0OrmXmlUiDefinition.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/GenericGeneratorComposite.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/GenericGeneratorsComposite.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateAbstractInheritanceComposite.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateAddQueryDialog.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateColumnComposite.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateDiscriminatorColumnComposite.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateGenerationComposite.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateNamedNativeQueryPropertyComposite.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateQueriesComposite.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateQueryPropertyComposite.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/IndexHolderComposite.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/ParametersComposite.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/TypeComposite.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/TypeDefPropertyComposite.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/TypeDefsComposite.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/java/PackageInfoResourceUIDefinition.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/orm/HibernateOrmXmlUiDefinition.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/persistence/details/HibernatePersistenceUnitClassesComposite.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/persistence/details/HibernatePersistenceXmlUiDefinition.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/persistence/details/HibernatePropertiesComposite.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/persistence/details/jpa2/HibernatePersistenceXml2_0UiDefinition.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/platform/HibernateJpa2_0PlatformUiFactory.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/platform/HibernateJpaPlatformUi.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/platform/HibernateJpaPlatformUiFactory.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/widgets/EnterNameDialog.java
   trunk/hibernatetools/tests/org.jboss.tools.hibernate.jpt.core.test/src/org/jboss/tools/hibernate/jpt/core/test/HibernateJpaModelTests.java
   trunk/hibernatetools/tests/org.jboss.tools.hibernate.jpt.core.test/src/org/jboss/tools/hibernate/jpt/core/test/HibernateJpaOrmModelTests.java
Log:
Migrate JPT plugins to Eclipse Juno(4.2)

Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/properties/HibernatePropertyPage.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/properties/HibernatePropertyPage.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/properties/HibernatePropertyPage.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -35,6 +35,7 @@
 import org.eclipse.core.runtime.IAdaptable;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
 import org.eclipse.core.runtime.preferences.IScopeContext;
 import org.eclipse.jdt.core.IJavaElement;
 import org.eclipse.jdt.core.IJavaProject;
@@ -43,7 +44,6 @@
 import org.eclipse.jface.operation.IRunnableWithProgress;
 import org.eclipse.jface.preference.PreferencePage;
 import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.SelectionAdapter;
 import org.eclipse.swt.events.SelectionEvent;
@@ -341,8 +341,11 @@
 				final IWorkspaceRunnable wr = new IWorkspaceRunnable() {
 					public void run(IProgressMonitor monitor)
 							throws CoreException {
-						// FIXME migration to latest JPA version required
-						//JptJpaCorePlugin.rebuildJpaProject(getProject());
+						try {
+							((JpaProject.Reference) getProject().getAdapter(JpaProject.Reference.class)).rebuild();
+						} catch (InterruptedException e) {
+							throw new CoreException(new Status(IStatus.CANCEL, HibernateConsolePlugin.ID, null, e));
+						}
 						getProject().build(IncrementalProjectBuilder.FULL_BUILD, monitor);
 					}
 				};

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateAbstractJpaFactory.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateAbstractJpaFactory.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateAbstractJpaFactory.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -11,9 +11,11 @@
 
 package org.jboss.tools.hibernate.jpt.core.internal;
 
+import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
+import org.eclipse.jpt.common.core.resource.java.JavaResourcePackage;
 import org.eclipse.jpt.jpa.core.JpaProject;
 import org.eclipse.jpt.jpa.core.context.JpaContextNode;
-import org.eclipse.jpt.jpa.core.context.Table.Owner;
+import org.eclipse.jpt.jpa.core.context.ReadOnlyTable;
 import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMapping;
 import org.eclipse.jpt.jpa.core.context.java.JavaBasicMapping;
 import org.eclipse.jpt.jpa.core.context.java.JavaColumn;
@@ -21,6 +23,7 @@
 import org.eclipse.jpt.jpa.core.context.java.JavaDiscriminatorColumn;
 import org.eclipse.jpt.jpa.core.context.java.JavaEntity;
 import org.eclipse.jpt.jpa.core.context.java.JavaGeneratorContainer;
+import org.eclipse.jpt.jpa.core.context.java.JavaGeneratorContainer.ParentAdapter;
 import org.eclipse.jpt.jpa.core.context.java.JavaIdMapping;
 import org.eclipse.jpt.jpa.core.context.java.JavaJoinColumn;
 import org.eclipse.jpt.jpa.core.context.java.JavaJoinTable;
@@ -33,13 +36,12 @@
 import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
 import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
 import org.eclipse.jpt.jpa.core.context.java.JavaQueryContainer;
+import org.eclipse.jpt.jpa.core.context.java.JavaReadOnlyJoinColumn;
 import org.eclipse.jpt.jpa.core.context.java.JavaSecondaryTable;
 import org.eclipse.jpt.jpa.core.context.java.JavaTable;
 import org.eclipse.jpt.jpa.core.internal.AbstractJpaFactory;
+import org.eclipse.jpt.jpa.core.resource.java.CompleteJoinColumnAnnotation;
 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.JavaResourcePackage;
-import org.eclipse.jpt.jpa.core.resource.java.JoinColumnAnnotation;
 import org.eclipse.jpt.jpa.core.resource.java.SecondaryTableAnnotation;
 import org.jboss.tools.hibernate.jpt.core.internal.context.ForeignKey;
 import org.jboss.tools.hibernate.jpt.core.internal.context.java.ForeignKeyAnnotation;
@@ -49,6 +51,7 @@
 import org.jboss.tools.hibernate.jpt.core.internal.context.java.HibernateJavaDiscriminatorColumnImpl;
 import org.jboss.tools.hibernate.jpt.core.internal.context.java.HibernateJavaEntity;
 import org.jboss.tools.hibernate.jpt.core.internal.context.java.HibernateJavaEntityImpl;
+import org.jboss.tools.hibernate.jpt.core.internal.context.java.HibernateJavaGeneratorContainer;
 import org.jboss.tools.hibernate.jpt.core.internal.context.java.HibernateJavaGeneratorContainerImpl;
 import org.jboss.tools.hibernate.jpt.core.internal.context.java.HibernateJavaIdMappingImpl;
 import org.jboss.tools.hibernate.jpt.core.internal.context.java.HibernateJavaJoinColumnImpl;
@@ -67,6 +70,7 @@
 import org.jboss.tools.hibernate.jpt.core.internal.context.java.HibernateJavaTypeDefContainerImpl;
 import org.jboss.tools.hibernate.jpt.core.internal.context.java.HibernateNamedNativeQueryImpl;
 import org.jboss.tools.hibernate.jpt.core.internal.context.java.HibernateNamedQueryImpl;
+import org.jboss.tools.hibernate.jpt.core.internal.context.java.HibernatePackageInfo;
 import org.jboss.tools.hibernate.jpt.core.internal.context.java.HibernatePackageInfoImpl;
 import org.jboss.tools.hibernate.jpt.core.internal.context.java.IndexImpl;
 import org.jboss.tools.hibernate.jpt.core.internal.context.java.JavaDiscriminatorFormula;
@@ -74,7 +78,6 @@
 import org.jboss.tools.hibernate.jpt.core.internal.context.java.JavaGenericGenerator;
 import org.jboss.tools.hibernate.jpt.core.internal.context.java.JavaGenericGeneratorImpl;
 import org.jboss.tools.hibernate.jpt.core.internal.context.java.JavaIndex;
-import org.jboss.tools.hibernate.jpt.core.internal.context.java.JavaPackageInfo;
 import org.jboss.tools.hibernate.jpt.core.internal.context.java.JavaParameter;
 import org.jboss.tools.hibernate.jpt.core.internal.context.java.JavaType;
 import org.jboss.tools.hibernate.jpt.core.internal.context.java.JavaTypeConverterImpl;
@@ -115,7 +118,7 @@
 		return new HibernateJavaIdMappingImpl(parent);
 	}
 
-	public JavaGenericGenerator buildJavaGenericGenerator(JavaJpaContextNode parent, GenericGeneratorAnnotation annotation) {
+	public JavaGenericGenerator buildJavaGenericGenerator(HibernateJavaGeneratorContainer parent, GenericGeneratorAnnotation annotation) {
 		return new JavaGenericGeneratorImpl(parent, annotation);
 	}
 
@@ -177,9 +180,10 @@
 	}
 
 	@Override
-	public JavaJoinColumn buildJavaJoinColumn(JavaJpaContextNode parent,
-			org.eclipse.jpt.jpa.core.context.java.JavaJoinColumn.Owner owner,
-			JoinColumnAnnotation joinColumnAnnotation) {
+	public JavaJoinColumn buildJavaJoinColumn(
+			JavaJpaContextNode parent,
+			JavaReadOnlyJoinColumn.Owner owner,
+			CompleteJoinColumnAnnotation joinColumnAnnotation) {
 		return new HibernateJavaJoinColumnImpl(parent, owner, joinColumnAnnotation);
 	}
 
@@ -198,7 +202,7 @@
 	}
 	
 	@Override
-	public JavaTable buildJavaTable(JavaEntity parent, Owner owner) {
+	public JavaTable buildJavaTable(JavaEntity parent, ReadOnlyTable.Owner owner) {
 		return new HibernateJavaTableImpl(parent, owner);
 	}
 
@@ -213,12 +217,11 @@
 			org.eclipse.jpt.jpa.core.context.java.JavaQueryContainer.Owner owner) {
 		return new HibernateJavaQueryContainerImpl(parent, owner);
 	}
-
+	
 	@Override
 	public JavaGeneratorContainer buildJavaGeneratorContainer(
-			JavaJpaContextNode parent,
-			org.eclipse.jpt.jpa.core.context.java.JavaGeneratorContainer.Owner owner) {
-		return new HibernateJavaGeneratorContainerImpl(parent, owner);
+			ParentAdapter parentAdapter) {
+		return new HibernateJavaGeneratorContainerImpl(parentAdapter);
 	}
 
 	public HibernateJavaTypeDefContainer buildJavaTypeDefContainer(JavaJpaContextNode parent, JavaResourceAnnotatedElement annotatedElement) {
@@ -238,11 +241,11 @@
 	}
 
 	public JavaConverter buildJavaTypeConverter(JavaAttributeMapping parent,
-			TypeAnnotation converterAnnotation) {
-		return new JavaTypeConverterImpl(parent, converterAnnotation);
+			TypeAnnotation converterAnnotation, JavaConverter.Owner owner) {
+		return new JavaTypeConverterImpl(parent, converterAnnotation, owner);
 	}
 
-	public JavaPackageInfo buildJavaPackageInfo(
+	public HibernatePackageInfo buildJavaPackageInfo(
 			HibernateClassRef hibernateClassRef, JavaResourcePackage jrpt) {
 		return new HibernatePackageInfoImpl(hibernateClassRef, jrpt);
 	}

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJpaAnnotationDefinitionProvider.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJpaAnnotationDefinitionProvider.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJpaAnnotationDefinitionProvider.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -12,22 +12,23 @@
 
 import java.util.ArrayList;
 
+import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
+import org.eclipse.jpt.common.core.resource.java.NestableAnnotationDefinition;
 import org.eclipse.jpt.jpa.core.JpaAnnotationDefinitionProvider;
 import org.eclipse.jpt.jpa.core.internal.AbstractJpaAnnotationDefinitionProvider;
-import org.eclipse.jpt.jpa.core.resource.java.AnnotationDefinition;
 import org.jboss.tools.hibernate.jpt.core.internal.resource.java.DiscriminatorFormulaAnnotationImpl.DiscriminatorFormulaAnnotationDefinition;
 import org.jboss.tools.hibernate.jpt.core.internal.resource.java.ForeignKeyAnnotationImpl.ForeignKeyAnnotationDefinition;
 import org.jboss.tools.hibernate.jpt.core.internal.resource.java.GeneratedAnnotationImpl.GeneratedAnnotationDefinition;
-import org.jboss.tools.hibernate.jpt.core.internal.resource.java.GenericGeneratorAnnotationImpl.GenericGeneratorAnnotationDefinition;
+import org.jboss.tools.hibernate.jpt.core.internal.resource.java.GenericGeneratorAnnotationDefinition;
+import org.jboss.tools.hibernate.jpt.core.internal.resource.java.GenericGeneratorsAnnotationDefinition;
 import org.jboss.tools.hibernate.jpt.core.internal.resource.java.HibernateNamedNativeQueriesAnnotationDefinition;
 import org.jboss.tools.hibernate.jpt.core.internal.resource.java.HibernateNamedNativeQueryAnnotationDefinition;
 import org.jboss.tools.hibernate.jpt.core.internal.resource.java.HibernateNamedQueriesAnnotationDefinition;
 import org.jboss.tools.hibernate.jpt.core.internal.resource.java.HibernateNamedQueryAnnotationDefinition;
 import org.jboss.tools.hibernate.jpt.core.internal.resource.java.IndexAnnotationImpl.IndexAnnotationDefinition;
-import org.jboss.tools.hibernate.jpt.core.internal.resource.java.SourceGenericGeneratorsAnnotation.GenericGeneratorsAnnotationDefinition;
 import org.jboss.tools.hibernate.jpt.core.internal.resource.java.TypeAnnotationImpl.TypeAnnotationDefinition;
-import org.jboss.tools.hibernate.jpt.core.internal.resource.java.TypeDefAnnotationImpl.TypeDefAnnotationDefinition;
-import org.jboss.tools.hibernate.jpt.core.internal.resource.java.TypeDefsAnnotationImpl.TypeDefsAnnotationDefinition;
+import org.jboss.tools.hibernate.jpt.core.internal.resource.java.TypeDefAnnotationDefinition;
+import org.jboss.tools.hibernate.jpt.core.internal.resource.java.TypeDefsAnnotationDefinition;
 
 /**
  * @author Dmitry Geraskov
@@ -53,45 +54,42 @@
 	}
 
 	@Override
-	protected void addTypeAnnotationDefinitionsTo(ArrayList<AnnotationDefinition> definitions) {
-		definitions.add(GenericGeneratorAnnotationDefinition.instance());
+	protected void addAnnotationDefinitionsTo(ArrayList<AnnotationDefinition> definitions) {
+		//definitions.add(GenericGeneratorAnnotationDefinition.instance());
 		definitions.add(GenericGeneratorsAnnotationDefinition.instance());
-		definitions.add(TypeDefAnnotationDefinition.instance());
+		//definitions.add(TypeDefAnnotationDefinition.instance());
 		definitions.add(TypeDefsAnnotationDefinition.instance());
-		definitions.add(HibernateNamedQueryAnnotationDefinition.instance());
+		//definitions.add(HibernateNamedQueryAnnotationDefinition.instance());
 		definitions.add(HibernateNamedQueriesAnnotationDefinition.instance());
-		definitions.add(HibernateNamedNativeQueryAnnotationDefinition.instance());
+		//definitions.add(HibernateNamedNativeQueryAnnotationDefinition.instance());
 		definitions.add(HibernateNamedNativeQueriesAnnotationDefinition.instance());
 		definitions.add(DiscriminatorFormulaAnnotationDefinition.instance());
 		definitions.add(ForeignKeyAnnotationDefinition.instance());
-	}
-
-	@Override
-	protected void addAttributeAnnotationDefinitionsTo(ArrayList<AnnotationDefinition> definitions) {
-		definitions.add(GenericGeneratorAnnotationDefinition.instance());
+	//addAttributeAnnotationDefinitionsTo
+		//definitions.add(GenericGeneratorAnnotationDefinition.instance());
 		definitions.add(GeneratedAnnotationDefinition.instance());
-		definitions.add(TypeDefAnnotationDefinition.instance());
-		definitions.add(TypeDefsAnnotationDefinition.instance());
+		//definitions.add(TypeDefAnnotationDefinition.instance());
+		//definitions.add(TypeDefsAnnotationDefinition.instance());
 		definitions.add(IndexAnnotationDefinition.instance());
 		definitions.add(TypeAnnotationDefinition.instance());
-		definitions.add(ForeignKeyAnnotationDefinition.instance());
+		//definitions.add(ForeignKeyAnnotationDefinition.instance());
+	//addPackageAnnotationDefinitionsTo
+		//definitions.add(GenericGeneratorAnnotationDefinition.instance());
+		//definitions.add(GenericGeneratorsAnnotationDefinition.instance());
+		//definitions.add(HibernateNamedQueryAnnotationDefinition.instance());
+		//definitions.add(HibernateNamedQueriesAnnotationDefinition.instance());
+		//definitions.add(HibernateNamedNativeQueryAnnotationDefinition.instance());
+		//definitions.add(HibernateNamedNativeQueriesAnnotationDefinition.instance());
+		//definitions.add(TypeDefAnnotationDefinition.instance());
+		//definitions.add(TypeDefsAnnotationDefinition.instance());
 	}
 
 	@Override
-	protected void addTypeMappingAnnotationDefinitionsTo(
-			ArrayList<AnnotationDefinition> definitions) {
-	}
-
-	@Override
-	protected void addPackageAnnotationDefinitionsTo(
-			ArrayList<AnnotationDefinition> definitions) {
+	protected void addNestableAnnotationDefinitionsTo(ArrayList<NestableAnnotationDefinition> definitions) {
 		definitions.add(GenericGeneratorAnnotationDefinition.instance());
-		definitions.add(GenericGeneratorsAnnotationDefinition.instance());
+		definitions.add(TypeDefAnnotationDefinition.instance());
 		definitions.add(HibernateNamedQueryAnnotationDefinition.instance());
-		definitions.add(HibernateNamedQueriesAnnotationDefinition.instance());
 		definitions.add(HibernateNamedNativeQueryAnnotationDefinition.instance());
-		definitions.add(HibernateNamedNativeQueriesAnnotationDefinition.instance());
-		definitions.add(TypeDefAnnotationDefinition.instance());
-		definitions.add(TypeDefsAnnotationDefinition.instance());
 	}
+
 }

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJpaPlatform.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJpaPlatform.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJpaPlatform.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -10,13 +10,14 @@
  ******************************************************************************/
 package org.jboss.tools.hibernate.jpt.core.internal;
 
+import org.eclipse.jpt.common.core.AnnotationProvider;
 import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.jpa.core.JpaAnnotationProvider;
 import org.eclipse.jpt.jpa.core.JpaFactory;
 import org.eclipse.jpt.jpa.core.JpaPlatformProvider;
 import org.eclipse.jpt.jpa.core.JpaPlatformVariation;
 import org.eclipse.jpt.jpa.core.ResourceDefinition;
 import org.eclipse.jpt.jpa.core.internal.GenericJpaPlatform;
+import org.eclipse.persistence.jpa.jpql.parser.JPQLGrammar;
 
 /**
  * @author Dmitry Geraskov
@@ -38,8 +39,8 @@
 		return super.getResourceDefinition(resourceType);
 	}
 
-	public HibernateJpaPlatform(String id, Version jpaVersion, JpaFactory jpaFactory, JpaAnnotationProvider jpaAnnotationProvider, JpaPlatformProvider platformProvider, JpaPlatformVariation jpaVariation) {
-		super(id, jpaVersion, jpaFactory, jpaAnnotationProvider, platformProvider, jpaVariation);
+	public HibernateJpaPlatform(String id, Version jpaVersion, JpaFactory jpaFactory, AnnotationProvider annotationProvider, JpaPlatformProvider platformProvider, JpaPlatformVariation jpaVariation, JPQLGrammar jpqlGrammar) {
+		super(id, jpaVersion, jpaFactory, annotationProvider, platformProvider, jpaVariation, jpqlGrammar);
 	}
 
 }

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJpaPlatformFactory.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJpaPlatformFactory.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJpaPlatformFactory.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -10,15 +10,17 @@
  ******************************************************************************/
 package org.jboss.tools.hibernate.jpt.core.internal;
 
-import org.eclipse.jpt.jpa.core.JpaAnnotationProvider;
+import org.eclipse.jpt.common.core.JptResourceType;
 import org.eclipse.jpt.jpa.core.JpaFacet;
 import org.eclipse.jpt.jpa.core.JpaFactory;
 import org.eclipse.jpt.jpa.core.JpaPlatform;
 import org.eclipse.jpt.jpa.core.JpaPlatformFactory;
 import org.eclipse.jpt.jpa.core.JpaPlatformVariation;
+import org.eclipse.jpt.jpa.core.context.AccessType;
 import org.eclipse.jpt.jpa.core.internal.GenericJpaAnnotationDefinitionProvider;
-import org.eclipse.jpt.jpa.core.internal.GenericJpaAnnotationProvider;
 import org.eclipse.jpt.jpa.core.internal.GenericJpaPlatformFactory.SimpleVersion;
+import org.eclipse.jpt.jpa.core.internal.JpaAnnotationProvider;
+import org.eclipse.persistence.jpa.jpql.parser.JPQLGrammar1_0;
 
 /**
  * @author Dmitry Geraskov
@@ -40,7 +42,8 @@
 				buildJpaFactory(),
 				buildJpaAnnotationProvider(),
 				HibernateJpaPlatformProvider.instance(),
-				this.buildJpaPlatformVariation());
+				this.buildJpaPlatformVariation(),
+				JPQLGrammar1_0.instance());
 	}
 
 
@@ -54,8 +57,7 @@
 	}
 
 	protected JpaAnnotationProvider buildJpaAnnotationProvider() {
-		return new GenericJpaAnnotationProvider(
-				GenericJpaAnnotationDefinitionProvider.instance(),
+		return new JpaAnnotationProvider(GenericJpaAnnotationDefinitionProvider.instance(),
 				HibernateJpaAnnotationDefinitionProvider.instance());
 	}
 
@@ -67,6 +69,11 @@
 			public boolean isJoinTableOverridable() {
 				return false;
 			}
+			@Override
+			public AccessType[] getSupportedAccessTypes(
+					JptResourceType resourceType) {
+				return GENERIC_SUPPORTED_ACCESS_TYPES;
+			}
 		};
 	}
 

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJpaProject.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJpaProject.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJpaProject.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -16,13 +16,13 @@
 import org.eclipse.core.resources.ProjectScope;
 import org.eclipse.core.runtime.preferences.IScopeContext;
 import org.eclipse.jpt.common.core.JptCommonCorePlugin;
+import org.eclipse.jpt.common.core.resource.java.JavaResourcePackage;
+import org.eclipse.jpt.common.core.resource.java.JavaResourcePackageInfoCompilationUnit;
 import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable;
 import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
 import org.eclipse.jpt.jpa.core.JpaFile;
 import org.eclipse.jpt.jpa.core.JpaProject;
 import org.eclipse.jpt.jpa.core.internal.AbstractJpaProject;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePackage;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePackageInfoCompilationUnit;
 import org.eclipse.wst.validation.internal.provisional.core.IMessage;
 import org.eclipse.wst.validation.internal.provisional.core.IReporter;
 import org.hibernate.cfg.Configuration;

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJptPlugin.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJptPlugin.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJptPlugin.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -25,10 +25,11 @@
 import org.eclipse.core.runtime.Plugin;
 import org.eclipse.core.runtime.Status;
 import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
+import org.eclipse.jpt.jpa.core.JpaProjectManager;
 import org.hibernate.console.ConsoleConfiguration;
 import org.hibernate.console.KnownConfigurations;
 import org.hibernate.console.KnownConfigurationsAdapter;
+import org.hibernate.eclipse.console.HibernateConsolePlugin;
 import org.osgi.framework.BundleContext;
 
 /**
@@ -105,7 +106,8 @@
 
 			private void revalidateProjects(ConsoleConfiguration ccfg){
 				//INFO: should revalidate project to calculate correct naming strategy's values
-				Iterator<JpaProject> jpaProjects = JptJpaCorePlugin.getJpaProjectManager().getJpaProjects().iterator();
+				JpaProjectManager manager = (JpaProjectManager) ResourcesPlugin.getWorkspace().getAdapter(JpaProjectManager.class);
+				Iterator<JpaProject> jpaProjects = manager.getJpaProjects().iterator();
 				while (jpaProjects.hasNext()) {
 					JpaProject jpaProject = jpaProjects.next();
 					if (jpaProject instanceof HibernateJpaProject) {
@@ -150,7 +152,12 @@
 			final IWorkspaceRunnable wr = new IWorkspaceRunnable() {
 				public void run(IProgressMonitor monitor)
 				throws CoreException {
-					JptJpaCorePlugin.rebuildJpaProject(project);
+					try {
+						((JpaProject.Reference) project.getAdapter(JpaProject.Reference.class)).rebuild();
+					} catch (InterruptedException e) {
+						throw new CoreException(new Status(IStatus.CANCEL, HibernateConsolePlugin.ID, null, e));
+					}
+					//TODO why we need this???
 					project.build(IncrementalProjectBuilder.FULL_BUILD, monitor);
 				}
 			};

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/JavaPackageInfoResourceModelProviderPatched.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/JavaPackageInfoResourceModelProviderPatched.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/JavaPackageInfoResourceModelProviderPatched.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -16,10 +16,10 @@
 import org.eclipse.jdt.core.JavaCore;
 import org.eclipse.jdt.core.JavaModelException;
 import org.eclipse.jpt.common.core.JptCommonCorePlugin;
+import org.eclipse.jpt.common.core.internal.resource.java.source.SourcePackageInfoCompilationUnit;
+import org.eclipse.jpt.common.core.resource.java.JavaResourceCompilationUnit;
 import org.eclipse.jpt.jpa.core.JpaProject;
 import org.eclipse.jpt.jpa.core.JpaResourceModelProvider;
-import org.eclipse.jpt.jpa.core.internal.resource.java.source.SourcePackageInfoCompilationUnit;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceCompilationUnit;
 
 /**
  * @author Dmitry Geraskov
@@ -58,7 +58,7 @@
 						cu,
 						jpaProject.getJpaPlatform().getAnnotationProvider(),
 						jpaProject.getJpaPlatform().getAnnotationEditFormatter(),
-						jpaProject.getModifySharedDocumentCommandExecutor());
+						jpaProject.getManager().getModifySharedDocumentCommandExecutor());
 			} else {
 				//ignore package-info placed in default package as
 				//it doesn't have package declaration and can't hold annotations

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/HibernateGeneratorContainer.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/HibernateGeneratorContainer.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/HibernateGeneratorContainer.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -11,8 +11,7 @@
 
 package org.jboss.tools.hibernate.jpt.core.internal.context;
 
-import java.util.ListIterator;
-
+import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
 import org.eclipse.jpt.jpa.core.context.GeneratorContainer;
 
 /**
@@ -32,12 +31,12 @@
 	 * Return a list iterator of the generic generators.
 	 * This will not be null.
 	 */
-	ListIterator<? extends GenericGenerator> genericGenerators();
+	ListIterable<? extends GenericGenerator> getGenericGenerators();
 	
 	/**
 	 * Return the number of generic generators.
 	 */
-	int genericGeneratorsSize();
+	int getGenericGeneratorsSize();
 
 	/**
 	 * Add a generic generator to the entity return the object representing it.

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/HibernatePersistenceUnit.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/HibernatePersistenceUnit.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/HibernatePersistenceUnit.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -10,7 +10,7 @@
  ******************************************************************************/
 package org.jboss.tools.hibernate.jpt.core.internal.context;
 
-import java.util.ArrayList;
+import java.io.File;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
@@ -25,19 +25,19 @@
 import org.eclipse.jdt.core.IJavaProject;
 import org.eclipse.jdt.core.IPackageFragmentRoot;
 import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
 import org.eclipse.jpt.common.utility.internal.NotNullFilter;
 import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
 import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable;
+import org.eclipse.jpt.common.utility.internal.iterables.SubIterableWrapper;
 import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
 import org.eclipse.jpt.common.utility.internal.iterators.CloneListIterator;
 import org.eclipse.jpt.jpa.core.context.Generator;
-import org.eclipse.jpt.jpa.core.context.GeneratorContainer;
-import org.eclipse.jpt.jpa.core.context.Query;
-import org.eclipse.jpt.jpa.core.context.QueryContainer;
+import org.eclipse.jpt.jpa.core.context.java.JavaGenerator;
 import org.eclipse.jpt.jpa.core.context.persistence.ClassRef;
 import org.eclipse.jpt.jpa.core.context.persistence.Persistence;
+import org.eclipse.jpt.jpa.core.internal.GenericJpaJpqlQueryHelper;
 import org.eclipse.jpt.jpa.core.internal.context.persistence.AbstractPersistenceUnit;
+import org.eclipse.jpt.jpa.core.jpql.JpaJpqlQueryHelper;
 import org.eclipse.jpt.jpa.core.resource.persistence.XmlPersistenceUnit;
 import org.eclipse.wst.validation.internal.provisional.core.IMessage;
 import org.eclipse.wst.validation.internal.provisional.core.IReporter;
@@ -46,9 +46,7 @@
 import org.jboss.tools.hibernate.jpt.core.internal.context.basic.BasicHibernateProperties;
 import org.jboss.tools.hibernate.jpt.core.internal.context.basic.Hibernate;
 import org.jboss.tools.hibernate.jpt.core.internal.context.basic.HibernatePersistenceUnitProperties;
-import org.jboss.tools.hibernate.jpt.core.internal.context.java.HibernateJavaQueryContainer;
 import org.jboss.tools.hibernate.jpt.core.internal.context.java.HibernatePackageInfo;
-import org.jboss.tools.hibernate.jpt.core.internal.context.java.JavaPackageInfo;
 import org.jboss.tools.hibernate.jpt.core.internal.context.java.JavaTypeDef;
 import org.jboss.tools.hibernate.jpt.core.internal.context.persistence.HibernateClassRef;
 import org.jboss.tools.hibernate.jpt.core.internal.context.persistence.HibernatePersistenceUnitPropertiesBuilder;
@@ -159,121 +157,52 @@
 	}
 	
 	/**
-	 * Return the non-<code>null</code> class ref package infos,
-	 * both specified and implied.
-	 */
-	protected Iterable<JavaPackageInfo> getClassRefPackageInfos() {
-		return new FilteringIterable<JavaPackageInfo>(
-					this.getClassRefPackageInfos_(),
-					NotNullFilter.<JavaPackageInfo>instance()
-				);
-	}
-	
-	protected Iterable<JavaPackageInfo> getClassRefPackageInfos_() {
-		return new TransformationIterable<ClassRef, JavaPackageInfo>(this.getClassRefs()) {
-			@Override
-			protected JavaPackageInfo transform(ClassRef classRef) {
-				return ((HibernateClassRef)classRef).getJavaPackageInfo();
-			}
-		};
-	}
-	
-	/**
-	 * Need to collect also Queries from package-info.java
-	 */
-	protected void addJavaQueriesTo(ArrayList<Query> queryList) {
-		super.addJavaQueriesTo(queryList);
-		this.addPackageJavaQueriesTo(this.getClassRefPackageInfos(), queryList);
-	}
-
-	protected void addPackageJavaQueriesTo(Iterable<JavaPackageInfo> packageInfos, ArrayList<Query> queryList) {
-		for (JavaPackageInfo packageInfo : packageInfos) {
-			if (packageInfo instanceof HibernatePackageInfo) {
-				this.addQueriesTo(((HibernatePackageInfo) packageInfo).getQueryContainer(), queryList);
-			}
-		}
-	}
-	
-	@Override
-	protected void addQueriesTo(QueryContainer queryContainer,
-			ArrayList<Query> queryList) {
-		super.addQueriesTo(queryContainer, queryList);
-		if (queryContainer instanceof HibernateJavaQueryContainer) {
-			CollectionTools.addAll(queryList, ((HibernateJavaQueryContainer)queryContainer).hibernateNamedQueries());
-			CollectionTools.addAll(queryList, ((HibernateJavaQueryContainer)queryContainer).hibernateNamedNativeQueries());
-		}
-	}
-	
-	/**
-	 * Include "overridden" Java generators.
-	 */
-	protected void addJavaGeneratorsTo(ArrayList<Generator> generatorList) {
-		super.addJavaGeneratorsTo(generatorList);
-		this.addPackageJavaGeneratorsTo(this.getClassRefPackageInfos(), generatorList);
-	}
-	
-	protected void addPackageJavaGeneratorsTo(Iterable<JavaPackageInfo> pacakgeInfos, ArrayList<Generator> generatorList) {
-		for (JavaPackageInfo packageInfo : pacakgeInfos) {
-			if (packageInfo instanceof HibernatePackageInfo) {
-				this.addGeneratorsTo(((HibernatePackageInfo) packageInfo).getGeneratorContainer(), generatorList);
-			}
-		}
-	}
-	
-	@Override
-	protected void addGeneratorsTo(GeneratorContainer generatorContainer,
-			ArrayList<Generator> generatorList) {
-		super.addGeneratorsTo(generatorContainer, generatorList);
-		//it could be orm generators container
-		//which is not implemented for hibernate platform
-		if (generatorContainer instanceof HibernateGeneratorContainer) {
-			CollectionTools.addAll(generatorList, ((HibernateGeneratorContainer)generatorContainer).genericGenerators());
-		}
-	}
-	
-	/**
 	 * Return the names of all the Java classes and packages in the JPA project that are
 	 * mapped (i.e. have the appropriate annotation etc.) but not specified
 	 * in the persistence unit.
 	 */
 	@SuppressWarnings("unchecked")
+	@Override
 	protected Iterable<String> getImpliedClassNames_() {
 		return new CompositeIterable<String>(super.getImpliedClassNames_(),
 				new FilteringIterable<String>(this.getJpaProject().getMappedJavaSourcePackagesNames()) {
 					@Override
 					protected boolean accept(String mappedPackageName) {
-						return !HibernatePersistenceUnit.this.specifiesPackageInfo(mappedPackageName);
+						return !HibernatePersistenceUnit.this.specifiedPackageInfo(mappedPackageName);
 					}
 				}
 		);
-
 	}
 	
+	
+	
 	/**
 	 * Ignore implied class refs and jar files.
 	 */
-	public boolean specifiesPackageInfo(String typeName) {
+	public boolean specifiedPackageInfo(String typeName) {
 		for (ClassRef classRef : this.getSpecifiedClassRefs()) {
 			if (classRef.isFor(typeName)) {
 				return true;
 			}
 		}
-		/*for (MappingFileRef mappingFileRef : this.getMappingFileRefs()) {
-			if (mappingFileRef.getPersistentType(typeName) != null) {
+		return false;
+	}
+	
+	/**
+	 * Ignore implied class refs and jar files.
+	 */
+	public boolean impliedPackageInfo(String typeName) {
+		for (ClassRef classRef : this.getImpliedClassRefs()) {
+			if (classRef.isFor(typeName)) {
 				return true;
 			}
-		}*/
+		}
 		return false;
 	}
 
 	// ********** Validation ***********************************************
 	@Override
-	public void validate(List<IMessage> messages, IReporter reporter) {
-		super.validate(messages, reporter);
-		validateHibernateConfigurationFileExists(messages, reporter);
-	}
-
-	protected void validateHibernateConfigurationFileExists(List<IMessage> messages, IReporter reporter) {
+	protected void validateProperties(List<IMessage> messages, IReporter reporter) {
 		String configFile = this.hibernateProperties.getConfigurationFile();
 		if (configFile != null && configFile.length() > 0){
 			IPath path = new Path(configFile);
@@ -329,7 +258,47 @@
 			}
 		}
 	}
+	
+	@Override
+	public JpaJpqlQueryHelper createJpqlQueryHelper() {
+		return new GenericJpaJpqlQueryHelper(this.getJpaPlatform().getJpqlGrammar());
+	}
+	
+	@SuppressWarnings("unchecked")
+	protected Iterable<JavaGenerator> getAllJavaGenerators() {
+		return new CompositeIterable<JavaGenerator>(
+				new CompositeIterable<JavaGenerator>(this.getAllJavaTypeMappingGeneratorLists()),
+				new CompositeIterable<JavaGenerator>(this.getAllPackageInfoMappingGeneratorLists()));
+	}
 
+	/**
+	 * @return
+	 */
+	protected Iterable<Iterable<JavaGenerator>>  getAllPackageInfoMappingGeneratorLists() {
+		return new TransformationIterable<HibernatePackageInfo, Iterable<JavaGenerator>>(this.getClassRefPackageInfos_()) {
+			@Override
+			protected Iterable<JavaGenerator> transform(HibernatePackageInfo o) {
+				return new SubIterableWrapper<Generator, JavaGenerator>(this.transform_(o));
+			}
+			protected Iterable<Generator> transform_(HibernatePackageInfo o) {
+				return o.getGeneratorContainer().getGenerators();
+			}
+		};
+	}
 
+	
+	protected Iterable<HibernatePackageInfo> getClassRefPackageInfos_() {
+		return new FilteringIterable<HibernatePackageInfo>(
+				new TransformationIterable<HibernateClassRef, HibernatePackageInfo>(
+						new SubIterableWrapper<ClassRef,HibernateClassRef>(this.getClassRefs())) {
+					@Override
+					protected HibernatePackageInfo transform(HibernateClassRef classRef) {
+						return classRef.getJavaPackageInfo();
+					}
+				},
+				NotNullFilter.<HibernatePackageInfo>instance()
+		);
+	}
+	
 
 }

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/NamingStrategyMappingTools.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/NamingStrategyMappingTools.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/NamingStrategyMappingTools.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -12,6 +12,7 @@
 
 import org.eclipse.jpt.jpa.core.context.Entity;
 import org.eclipse.jpt.jpa.core.context.JoinColumn;
+import org.eclipse.jpt.jpa.core.context.ReadOnlyJoinColumn;
 import org.eclipse.jpt.jpa.core.context.Relationship;
 import org.eclipse.jpt.jpa.core.context.RelationshipMapping;
 import org.eclipse.jpt.jpa.db.Table;
@@ -108,8 +109,8 @@
 		return owningTable.getDatabase().convertNameToIdentifier(name);
 	}
 
-	public static String buildJoinColumnDefaultName(JoinColumn joinColumn, JoinColumn.Owner owner) {
-		if (owner.joinColumnsSize() != 1) {
+	public static String buildJoinColumnDefaultName(JoinColumn joinColumn, ReadOnlyJoinColumn.Owner owner) {
+		if (owner.getJoinColumnsSize() != 1) {
 			return null;
 		}
 		String prefix = owner.getAttributeName();

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/definition/HibernateJavaBasicMappingDefinition.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/definition/HibernateJavaBasicMappingDefinition.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/definition/HibernateJavaBasicMappingDefinition.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -56,7 +56,7 @@
 	}
 
 	public boolean isSpecified(JavaPersistentAttribute persistentAttribute) {
-		return persistentAttribute.getResourcePersistentAttribute().getAnnotation(this.getAnnotationName()) != null;
+		return persistentAttribute.getResourceAttribute().getAnnotation(this.getAnnotationName()) != null;
 	}
 
 	protected static final String[] HIBERNATE_ANNOTATION_NAMES_ARRAY = new String[] {

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/definition/HibernateJavaEntityDefinition.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/definition/HibernateJavaEntityDefinition.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/definition/HibernateJavaEntityDefinition.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -10,31 +10,25 @@
  ******************************************************************************/
 package org.jboss.tools.hibernate.jpt.core.internal.context.definition;
 
+import org.eclipse.jpt.common.core.resource.java.Annotation;
 import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
 import org.eclipse.jpt.jpa.core.JpaFactory;
 import org.eclipse.jpt.jpa.core.MappingKeys;
 import org.eclipse.jpt.jpa.core.context.java.JavaEntity;
 import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
 import org.eclipse.jpt.jpa.core.context.java.JavaTypeMappingDefinition;
-import org.eclipse.jpt.jpa.core.resource.java.Annotation;
 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.AttributeOverrideAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.AttributeOverridesAnnotation;
 import org.eclipse.jpt.jpa.core.resource.java.DiscriminatorColumnAnnotation;
 import org.eclipse.jpt.jpa.core.resource.java.DiscriminatorValueAnnotation;
 import org.eclipse.jpt.jpa.core.resource.java.EntityAnnotation;
 import org.eclipse.jpt.jpa.core.resource.java.IdClassAnnotation;
 import org.eclipse.jpt.jpa.core.resource.java.InheritanceAnnotation;
 import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.NamedNativeQueriesAnnotation;
 import org.eclipse.jpt.jpa.core.resource.java.NamedNativeQueryAnnotation;
-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.PrimaryKeyJoinColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.PrimaryKeyJoinColumnsAnnotation;
 import org.eclipse.jpt.jpa.core.resource.java.SecondaryTableAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.SecondaryTablesAnnotation;
 import org.eclipse.jpt.jpa.core.resource.java.SequenceGeneratorAnnotation;
 import org.eclipse.jpt.jpa.core.resource.java.TableAnnotation;
 import org.eclipse.jpt.jpa.core.resource.java.TableGeneratorAnnotation;
@@ -79,9 +73,9 @@
 	protected static final String[] SUPPORTING_ANNOTATION_NAMES_ARRAY = new String[] {
 			TableAnnotation.ANNOTATION_NAME,
 			SecondaryTableAnnotation.ANNOTATION_NAME,
-			SecondaryTablesAnnotation.ANNOTATION_NAME,
+			JPA.SECONDARY_TABLES,
 			PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME,
-			PrimaryKeyJoinColumnsAnnotation.ANNOTATION_NAME,
+			JPA.PRIMARY_KEY_JOIN_COLUMNS,
 			IdClassAnnotation.ANNOTATION_NAME,
 			InheritanceAnnotation.ANNOTATION_NAME,
 			DiscriminatorValueAnnotation.ANNOTATION_NAME,
@@ -89,9 +83,9 @@
 			SequenceGeneratorAnnotation.ANNOTATION_NAME,
 			TableGeneratorAnnotation.ANNOTATION_NAME,
 			NamedQueryAnnotation.ANNOTATION_NAME,
-			NamedQueriesAnnotation.ANNOTATION_NAME,
+			JPA.NAMED_QUERIES,
 			NamedNativeQueryAnnotation.ANNOTATION_NAME,
-			NamedNativeQueriesAnnotation.ANNOTATION_NAME,
+			JPA.NAMED_NATIVE_QUERIES,
 			JPA.SQL_RESULT_SET_MAPPING,
 			JPA.EXCLUDE_DEFAULT_LISTENERS,
 			JPA.EXCLUDE_SUPERCLASS_LISTENERS,
@@ -104,9 +98,9 @@
 			JPA.POST_UPDATE,
 			JPA.POST_LOAD,
 			AttributeOverrideAnnotation.ANNOTATION_NAME,
-			AttributeOverridesAnnotation.ANNOTATION_NAME,
+			JPA.ATTRIBUTE_OVERRIDES,
 			AssociationOverrideAnnotation.ANNOTATION_NAME,
-			AssociationOverridesAnnotation.ANNOTATION_NAME,
+			JPA.ASSOCIATION_OVERRIDES,
 			//TODO add Hibernate annotations here
 			Hibernate.GENERIC_GENERATOR,
 			Hibernate.GENERIC_GENERATORS,

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/definition/HibernateJavaIdMappingDefinition.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/definition/HibernateJavaIdMappingDefinition.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/definition/HibernateJavaIdMappingDefinition.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -57,7 +57,7 @@
 	}
 
 	public boolean isSpecified(JavaPersistentAttribute persistentAttribute) {
-		return persistentAttribute.getResourcePersistentAttribute().getAnnotation(this.getAnnotationName()) != null;
+		return persistentAttribute.getResourceAttribute().getAnnotation(this.getAnnotationName()) != null;
 	}
 
 	protected static final String[] HIBERNATE_ANNOTATION_NAMES_ARRAY = new String[] {

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/definition/HibernateJavaManyToManyMappingDefinition.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/definition/HibernateJavaManyToManyMappingDefinition.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/definition/HibernateJavaManyToManyMappingDefinition.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -56,7 +56,7 @@
 	}
 
 	public boolean isSpecified(JavaPersistentAttribute persistentAttribute) {
-		return persistentAttribute.getResourcePersistentAttribute().getAnnotation(this.getAnnotationName()) != null;
+		return persistentAttribute.getResourceAttribute().getAnnotation(this.getAnnotationName()) != null;
 	}
 
 	@Override

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/definition/HibernateJavaManyToOneMappingDefinition.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/definition/HibernateJavaManyToOneMappingDefinition.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/definition/HibernateJavaManyToOneMappingDefinition.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -17,8 +17,8 @@
 import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMapping;
 import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMappingDefinition;
 import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
+import org.eclipse.jpt.jpa.core.resource.java.JPA;
 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.JoinTableAnnotation;
 import org.eclipse.jpt.jpa.core.resource.java.ManyToOneAnnotation;
 import org.jboss.tools.hibernate.jpt.core.internal.context.basic.Hibernate;
@@ -55,7 +55,7 @@
 	}
 
 	public boolean isSpecified(JavaPersistentAttribute persistentAttribute) {
-		return persistentAttribute.getResourcePersistentAttribute().getAnnotation(this.getAnnotationName()) != null;
+		return persistentAttribute.getResourceAttribute().getAnnotation(this.getAnnotationName()) != null;
 	}
 
 	protected static final String[] HIBERNATE_ANNOTATION_NAMES_ARRAY = new String[] {
@@ -65,7 +65,7 @@
 	private static final String[] SUPPORTING_ANNOTATION_NAMES_ARRAY = new String[] {
 		JoinTableAnnotation.ANNOTATION_NAME,
 		JoinColumnAnnotation.ANNOTATION_NAME,
-		JoinColumnsAnnotation.ANNOTATION_NAME
+		JPA.JOIN_COLUMNS
 	};
 	private static final Iterable<String> SUPPORTING_ANNOTATION_NAMES = new ArrayIterable<String>(SUPPORTING_ANNOTATION_NAMES_ARRAY);
 

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/definition/HibernateJavaOneToManyMappingDefinition.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/definition/HibernateJavaOneToManyMappingDefinition.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/definition/HibernateJavaOneToManyMappingDefinition.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -17,8 +17,8 @@
 import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMapping;
 import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMappingDefinition;
 import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
+import org.eclipse.jpt.jpa.core.resource.java.JPA;
 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.JoinTableAnnotation;
 import org.eclipse.jpt.jpa.core.resource.java.MapKeyAnnotation;
 import org.eclipse.jpt.jpa.core.resource.java.OneToManyAnnotation;
@@ -57,7 +57,7 @@
 	}
 
 	public boolean isSpecified(JavaPersistentAttribute persistentAttribute) {
-		return persistentAttribute.getResourcePersistentAttribute().getAnnotation(this.getAnnotationName()) != null;
+		return persistentAttribute.getResourceAttribute().getAnnotation(this.getAnnotationName()) != null;
 	}
 	
 	protected static final String[] HIBERNATE_ANNOTATION_NAMES_ARRAY = new String[] {
@@ -69,7 +69,7 @@
 		MapKeyAnnotation.ANNOTATION_NAME,
 		OrderByAnnotation.ANNOTATION_NAME,
 		JoinColumnAnnotation.ANNOTATION_NAME,
-		JoinColumnsAnnotation.ANNOTATION_NAME
+		JPA.JOIN_COLUMNS
 	};
 	private static final Iterable<String> SUPPORTING_ANNOTATION_NAMES = new ArrayIterable<String>(SUPPORTING_ANNOTATION_NAMES_ARRAY);
 

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/definition/HibernateJavaOneToOneMappingDefinition.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/definition/HibernateJavaOneToOneMappingDefinition.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/definition/HibernateJavaOneToOneMappingDefinition.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -17,12 +17,11 @@
 import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMapping;
 import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMappingDefinition;
 import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
+import org.eclipse.jpt.jpa.core.resource.java.JPA;
 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.JoinTableAnnotation;
 import org.eclipse.jpt.jpa.core.resource.java.OneToOneAnnotation;
 import org.eclipse.jpt.jpa.core.resource.java.PrimaryKeyJoinColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.PrimaryKeyJoinColumnsAnnotation;
 import org.jboss.tools.hibernate.jpt.core.internal.context.basic.Hibernate;
 
 /**
@@ -57,7 +56,7 @@
 	}
 
 	public boolean isSpecified(JavaPersistentAttribute persistentAttribute) {
-		return persistentAttribute.getResourcePersistentAttribute().getAnnotation(this.getAnnotationName()) != null;
+		return persistentAttribute.getResourceAttribute().getAnnotation(this.getAnnotationName()) != null;
 	}
 	
 	protected static final String[] HIBERNATE_ANNOTATION_NAMES_ARRAY = new String[] {
@@ -67,9 +66,9 @@
 	private static final String[] SUPPORTING_ANNOTATION_NAMES_ARRAY = new String[] {
 		JoinTableAnnotation.ANNOTATION_NAME,
 		JoinColumnAnnotation.ANNOTATION_NAME,
-		JoinColumnsAnnotation.ANNOTATION_NAME,
+		JPA.JOIN_COLUMNS,
 		PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME,
-		PrimaryKeyJoinColumnsAnnotation.ANNOTATION_NAME
+		JPA.PRIMARY_KEY_JOIN_COLUMNS
 	};
 	private static final Iterable<String> SUPPORTING_ANNOTATION_NAMES = new ArrayIterable<String>(SUPPORTING_ANNOTATION_NAMES_ARRAY);
 

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/AbstractHibernateNamedQueryImpl.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/AbstractHibernateNamedQueryImpl.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/AbstractHibernateNamedQueryImpl.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -11,6 +11,7 @@
 package org.jboss.tools.hibernate.jpt.core.internal.context.java;
 
 import org.eclipse.jpt.jpa.core.context.java.JavaJpaContextNode;
+import org.eclipse.jpt.jpa.core.context.orm.OrmQueryContainer;
 import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaQuery;
 import org.jboss.tools.hibernate.jpt.core.internal.context.CacheModeType;
 import org.jboss.tools.hibernate.jpt.core.internal.context.FlushModeType;
@@ -76,7 +77,17 @@
 	private FlushModeType getResourceFlushMode(HibernateQueryAnnotation queryAnnotation) {
 		return FlushModeType.fromJavaAnnotationValue(queryAnnotation);
 	}
+	
+	public void convertTo(OrmQueryContainer queryContainer) {
+		throw new UnsupportedOperationException();
+	}
 
+	
+	@Override
+	public HibernateJavaQueryContainer getParent() {
+		return (HibernateJavaQueryContainer) super.getParent();
+	}
+
 	// ****** flushMode
 	@Override
 	public FlushModeType getFlushMode() {

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/ForeignKeyAnnotation.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/ForeignKeyAnnotation.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/ForeignKeyAnnotation.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -12,8 +12,8 @@
 package org.jboss.tools.hibernate.jpt.core.internal.context.java;
 
 import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jpt.common.core.resource.java.Annotation;
 import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.java.Annotation;
 import org.jboss.tools.hibernate.jpt.core.internal.context.basic.Hibernate;
 
 /**

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaBasicMappingImpl.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaBasicMappingImpl.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaBasicMappingImpl.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -19,8 +19,8 @@
 import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
 import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
 import org.eclipse.jpt.jpa.core.context.java.JavaConverter;
+import org.eclipse.jpt.jpa.core.context.java.JavaConverter.Adapter;
 import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaConverter.Adapter;
 import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaBasicMapping;
 import org.eclipse.wst.validation.internal.provisional.core.IMessage;
 import org.eclipse.wst.validation.internal.provisional.core.IReporter;
@@ -85,15 +85,15 @@
 	}
 
 	public GeneratedAnnotation getGeneratedAnnotation() {
-		return (GeneratedAnnotation) getResourcePersistentAttribute().getAnnotation(GeneratedAnnotation.ANNOTATION_NAME);
+		return (GeneratedAnnotation) getResourceAttribute().getAnnotation(GeneratedAnnotation.ANNOTATION_NAME);
 	}
 
 	public GeneratedAnnotation buildGeneratedAnnotation() {
-		return (GeneratedAnnotation) getResourcePersistentAttribute().addAnnotation(GeneratedAnnotation.ANNOTATION_NAME);
+		return (GeneratedAnnotation) getResourceAttribute().addAnnotation(GeneratedAnnotation.ANNOTATION_NAME);
 	}
 
 	public void removeGeneratedAnnotation() {
-		getResourcePersistentAttribute().removeAnnotation(GeneratedAnnotation.ANNOTATION_NAME);
+		getResourceAttribute().removeAnnotation(GeneratedAnnotation.ANNOTATION_NAME);
 	}
 
 	protected GenerationTime getResourceGenerationTime(){
@@ -141,14 +141,14 @@
 	}
 	
 	protected IndexAnnotation buildIndexAnnotation() {
-		return (IndexAnnotation) this.getResourcePersistentAttribute().addAnnotation(IndexAnnotation.ANNOTATION_NAME);
+		return (IndexAnnotation) this.getResourceAttribute().addAnnotation(IndexAnnotation.ANNOTATION_NAME);
 	}
 	
 	public void removeIndex() {
 		if (getIndex() == null) {
 			throw new IllegalStateException("index does not exist, cannot be removed"); //$NON-NLS-1$
 		}
-		this.getResourcePersistentAttribute().removeAnnotation(IndexAnnotation.ANNOTATION_NAME);
+		this.getResourceAttribute().removeAnnotation(IndexAnnotation.ANNOTATION_NAME);
 		setIndex(null);
 	}
 
@@ -158,7 +158,7 @@
 	}
 	
 	protected IndexAnnotation getIndexAnnotation() {
-		return (IndexAnnotation) this.getResourcePersistentAttribute().getAnnotation(IndexAnnotation.ANNOTATION_NAME);
+		return (IndexAnnotation) this.getResourceAttribute().getAnnotation(IndexAnnotation.ANNOTATION_NAME);
 	}
 	
 	protected JavaIndex buildIndex(IndexAnnotation annotation) {
@@ -205,14 +205,14 @@
 	}
 
 	protected TypeAnnotation buildTypeAnnotation() {
-		return (TypeAnnotation) this.getResourcePersistentAttribute().addAnnotation(TypeAnnotation.ANNOTATION_NAME);
+		return (TypeAnnotation) this.getResourceAttribute().addAnnotation(TypeAnnotation.ANNOTATION_NAME);
 	}
 
 	public void removeType() {
 		if (this.type == null) {
 			throw new IllegalStateException("generated value does not exist"); //$NON-NLS-1$
 		}
-		this.getResourcePersistentAttribute().removeAnnotation(TypeAnnotation.ANNOTATION_NAME);
+		this.getResourceAttribute().removeAnnotation(TypeAnnotation.ANNOTATION_NAME);
 		this.setType(null);
 	}
 
@@ -222,7 +222,7 @@
 	}
 
 	protected TypeAnnotation getTypeAnnotation() {
-		return (TypeAnnotation) this.getResourcePersistentAttribute().getAnnotation(TypeAnnotation.ANNOTATION_NAME);
+		return (TypeAnnotation) this.getResourceAttribute().getAnnotation(TypeAnnotation.ANNOTATION_NAME);
 	}
 
 	protected JavaType buildType(TypeAnnotation generatedValueAnnotation) {
@@ -259,15 +259,15 @@
 	 * org.eclipse.jdt.core.dom.CompilationUnit)
 	 */
 	@Override
-	public Iterator<String> javaCompletionProposals(int pos,
+	public Iterable<String> getJavaCompletionProposals(int pos,
 			Filter<String> filter, CompilationUnit astRoot) {
-		Iterator<String> result = super.javaCompletionProposals(pos, filter,
+		Iterable<String> result = super.getJavaCompletionProposals(pos, filter,
 				astRoot);
 		if (result != null) {
 			return result;
 		}
 		if (this.getType() != null) {
-			result = this.getType().javaCompletionProposals(pos, filter,
+			result = this.getType().getJavaCompletionProposals(pos, filter,
 					astRoot);
 			if (result != null) {
 				return result;

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaDiscriminatorColumnImpl.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaDiscriminatorColumnImpl.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaDiscriminatorColumnImpl.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -17,7 +17,6 @@
 import org.eclipse.jpt.jpa.core.context.java.JavaDiscriminatorColumn;
 import org.eclipse.jpt.jpa.core.context.java.JavaEntity;
 import org.eclipse.jpt.jpa.core.internal.jpa1.context.java.GenericJavaDiscriminatorColumn;
-import org.eclipse.jpt.jpa.core.internal.validation.DefaultJpaValidationMessages;
 import org.eclipse.jpt.jpa.core.internal.validation.JpaValidationMessages;
 import org.eclipse.jpt.jpa.db.Column;
 import org.eclipse.jpt.jpa.db.Table;

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaEntity.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaEntity.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaEntity.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -11,7 +11,6 @@
 package org.jboss.tools.hibernate.jpt.core.internal.context.java;
 
 import org.eclipse.jpt.jpa.core.context.java.JavaEntity;
-import org.jboss.tools.hibernate.jpt.core.internal.context.ForeignKeyHolder;
 import org.jboss.tools.hibernate.jpt.core.internal.context.HibernateEntity;
 
 /**

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaEntityImpl.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaEntityImpl.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaEntityImpl.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -10,7 +10,6 @@
  ******************************************************************************/
 package org.jboss.tools.hibernate.jpt.core.internal.context.java;
 
-import java.util.Iterator;
 import java.util.List;
 
 import org.eclipse.jdt.core.dom.CompilationUnit;
@@ -22,6 +21,7 @@
 import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
 import org.eclipse.jpt.jpa.core.context.BaseJoinColumn;
 import org.eclipse.jpt.jpa.core.context.Entity;
+import org.eclipse.jpt.jpa.core.context.ReadOnlyNamedColumn;
 import org.eclipse.jpt.jpa.core.context.ReadOnlyTable;
 import org.eclipse.jpt.jpa.core.context.TypeMapping;
 import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
@@ -32,7 +32,6 @@
 import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaCacheable2_0;
 import org.eclipse.jpt.jpa.core.jpa2.context.persistence.PersistenceUnit2_0;
 import org.eclipse.jpt.jpa.core.resource.java.EntityAnnotation;
-import org.eclipse.wst.validation.internal.core.Message;
 import org.eclipse.wst.validation.internal.provisional.core.IMessage;
 import org.eclipse.wst.validation.internal.provisional.core.IReporter;
 import org.hibernate.cfg.NamingStrategy;
@@ -61,7 +60,7 @@
 	public HibernateJavaEntityImpl(JavaPersistentType parent, EntityAnnotation mappingAnnotation) {
 		super(parent, mappingAnnotation);
 		this.discriminatorFormula = this.buildDiscriminatorFormula();
-		this.typeDefContainer = getJpaFactory().buildJavaTypeDefContainer(parent, this.getResourcePersistentType());
+		this.typeDefContainer = getJpaFactory().buildJavaTypeDefContainer(parent, this.getJavaResourceType());
 		this.cacheable = this.buildJavaCachable();
 	}
 
@@ -128,7 +127,7 @@
 	}
 	
 	protected DiscriminatorFormulaAnnotation buildDiscriminatorFormulaAnnotation() {
-		return (DiscriminatorFormulaAnnotation) this.getResourcePersistentType().addAnnotation(DiscriminatorFormulaAnnotation.ANNOTATION_NAME);
+		return (DiscriminatorFormulaAnnotation) this.getJavaResourceType().addAnnotation(DiscriminatorFormulaAnnotation.ANNOTATION_NAME);
 	}
 	
 	@Override
@@ -136,7 +135,7 @@
 		if (getDiscriminatorFormula() == null) {
 			throw new IllegalStateException("discriminatorFormula does not exist, cannot be removed"); //$NON-NLS-1$
 		}
-		this.getResourcePersistentType().removeAnnotation(DiscriminatorFormulaAnnotation.ANNOTATION_NAME);
+		this.getJavaResourceType().removeAnnotation(DiscriminatorFormulaAnnotation.ANNOTATION_NAME);
 		this.setDiscriminatorFormula(null);
 	}
 
@@ -146,7 +145,7 @@
 	}
 
 	public DiscriminatorFormulaAnnotation getDiscriminatorFormulaAnnotation() {
-		return (DiscriminatorFormulaAnnotation) this.getResourcePersistentType().getAnnotation(DiscriminatorFormulaAnnotation.ANNOTATION_NAME);
+		return (DiscriminatorFormulaAnnotation) this.getJavaResourceType().getAnnotation(DiscriminatorFormulaAnnotation.ANNOTATION_NAME);
 	}
 
 	protected JavaDiscriminatorFormula buildDiscriminatorFormula(DiscriminatorFormulaAnnotation annotation) {
@@ -208,11 +207,6 @@
 			return HibernateJavaEntityImpl.this.getPrimaryTableName();
 		}
 
-		@Override
-		public TypeMapping getTypeMapping() {
-			return HibernateJavaEntityImpl.this;
-		}
-
 		public org.eclipse.jpt.jpa.db.Table getDbTable(String tableName) {
 			return HibernateJavaEntityImpl.this.resolveDbTable(tableName);
 		}
@@ -224,8 +218,8 @@
 		}
 
 		@Override
-		public int joinColumnsSize() {
-			return HibernateJavaEntityImpl.this.primaryKeyJoinColumnsSize();
+		public int getJoinColumnsSize() {
+			return HibernateJavaEntityImpl.this.getPrimaryKeyJoinColumnsSize();
 		}
 
 		public boolean isVirtual(BaseJoinColumn joinColumn) {
@@ -233,8 +227,8 @@
 		}
 
 		@Override
-		public String getDefaultColumnName() {
-			if (joinColumnsSize() != 1) {
+		public String getDefaultColumnName(ReadOnlyNamedColumn column) {
+			if (getJoinColumnsSize() != 1) {
 				return null;
 			}
 
@@ -252,7 +246,7 @@
 						return name ;
 					} catch (Exception e) {
 						IMessage m =HibernateJpaValidationMessage.buildMessage(IMessage.HIGH_SEVERITY,
-								Messages.NAMING_STRATEGY_EXCEPTION, this);
+								Messages.NAMING_STRATEGY_EXCEPTION, column);
 						HibernateJptPlugin.logException(m.getText(), e);
 					}
 				}
@@ -326,13 +320,13 @@
 	}
 
 	@Override
-	public Iterator<String> javaCompletionProposals(int pos,
+	public Iterable<String> getJavaCompletionProposals(int pos,
 			Filter<String> filter, CompilationUnit astRoot) {
-		Iterator<String> result = super.javaCompletionProposals(pos, filter, astRoot);
+		Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
 		if (result != null) {
 			return result;
 		}
-		result = this.getTypeDefContainer().javaCompletionProposals(pos, filter, astRoot);
+		result = this.getTypeDefContainer().getJavaCompletionProposals(pos, filter, astRoot);
 		if (result != null) {
 			return result;
 		}

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaGeneratorContainer.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaGeneratorContainer.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaGeneratorContainer.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -10,8 +10,7 @@
   ******************************************************************************/
 package org.jboss.tools.hibernate.jpt.core.internal.context.java;
 
-import java.util.ListIterator;
-
+import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
 import org.eclipse.jpt.jpa.core.context.java.JavaGeneratorContainer;
 import org.jboss.tools.hibernate.jpt.core.internal.context.HibernateGeneratorContainer;
 
@@ -23,8 +22,10 @@
 public interface HibernateJavaGeneratorContainer extends
 		HibernateGeneratorContainer, JavaGeneratorContainer {
 	
-	ListIterator<JavaGenericGenerator> genericGenerators();
+	ListIterable<JavaGenericGenerator> getGenericGenerators();
 	
 	JavaGenericGenerator addGenericGenerator(int index);
 
+	JavaGenericGenerator addGenericGenerator();
+
 }

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaGeneratorContainerImpl.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaGeneratorContainerImpl.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaGeneratorContainerImpl.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2010-2011 Red Hat, Inc.
+ * Copyright (c) 2010-2012 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,
@@ -10,40 +10,33 @@
  ******************************************************************************/
 package org.jboss.tools.hibernate.jpt.core.internal.context.java;
 
-import java.util.Iterator;
 import java.util.ListIterator;
-import java.util.Vector;
 
 import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
 import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
+import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
 import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SubIterableWrapper;
-import org.eclipse.jpt.jpa.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.jpa.core.internal.context.ContextContainerTools;
+import org.eclipse.jpt.common.utility.internal.iterables.SubListIterableWrapper;
+import org.eclipse.jpt.jpa.core.context.Generator;
 import org.eclipse.jpt.jpa.core.internal.jpa1.context.java.GenericJavaGeneratorContainer;
-import org.eclipse.jpt.jpa.core.resource.java.NestableAnnotation;
 import org.jboss.tools.hibernate.jpt.core.internal.HibernateAbstractJpaFactory;
 import org.jboss.tools.hibernate.jpt.core.internal.context.GenericGenerator;
 import org.jboss.tools.hibernate.jpt.core.internal.resource.java.GenericGeneratorAnnotation;
-import org.jboss.tools.hibernate.jpt.core.internal.resource.java.GenericGeneratorsAnnotation;
 
 /**
  * @author Dmitry Geraskov
  *
  */
- at SuppressWarnings("restriction")
 public class HibernateJavaGeneratorContainerImpl extends
 	GenericJavaGeneratorContainer implements
 	HibernateJavaGeneratorContainer {
 
-	protected final Vector<JavaGenericGenerator> genericGenerators = new Vector<JavaGenericGenerator>();
-	protected GenericGeneratorContainerAdapter genericGeneratorsContainerAdapter = new GenericGeneratorContainerAdapter();
-
-	public HibernateJavaGeneratorContainerImpl(JavaJpaContextNode parent, Owner owner) {
-		super(parent, owner);
-		this.initializeGenericGenerators();
+	protected final ContextListContainer<JavaGenericGenerator, GenericGeneratorAnnotation> genericGeneratorContainer;
+	
+	public HibernateJavaGeneratorContainerImpl(ParentAdapter parentAdapter) {
+		super(parentAdapter);
+		this.genericGeneratorContainer = this.buildGenericGeneratorContainer();
 	}
 
 	@Override
@@ -51,6 +44,7 @@
 		return (HibernateAbstractJpaFactory)super.getJpaFactory();
 	}
 
+	// ********** synchronize/update **********
 	@Override
 	public void synchronizeWithResourceModel() {
 		super.synchronizeWithResourceModel();
@@ -62,150 +56,108 @@
 		super.update();
 		this.updateNodes(this.getGenericGenerators());
 	}
-
-	// ******************* Generic Generators ****************
-
+	
 	@Override
-	public ListIterator<JavaGenericGenerator> genericGenerators() {
-		return this.getGenericGenerators().iterator();
+	protected Iterable<Generator> getGenerators_() {
+		return new CompositeIterable<Generator>(
+				super.getGenerators_(),
+				this.getGenericGenerators()
+			);
 	}
 
-	protected ListIterable<JavaGenericGenerator> getGenericGenerators() {
-		return new LiveCloneListIterable<JavaGenericGenerator>(this.genericGenerators);
+	// ******************* Generic Generators ****************
+	public ListIterable<JavaGenericGenerator> getGenericGenerators() {
+		return this.genericGeneratorContainer.getContextElements();
 	}
 
-	@Override
-	public int genericGeneratorsSize() {
-		return this.genericGenerators.size();
+	public int getGenericGeneratorsSize() {
+		return this.genericGeneratorContainer.getContextElementsSize();
 	}
 
-
 	public JavaGenericGenerator addGenericGenerator() {
-		return this.addGenericGenerator(this.genericGenerators.size());
+		return this.addGenericGenerator(this.getGenericGeneratorsSize());
 	}
 
-	@Override
 	public JavaGenericGenerator addGenericGenerator(int index) {
-		GenericGeneratorAnnotation annotation = this.buildGenericGeneratorAnnotation(index);
-		return this.addGenericGenerator_(index, annotation);
+		GenericGeneratorAnnotation annotation = this.addGenericGeneratorAnnotation(index);
+		return this.genericGeneratorContainer.addContextElement(index, annotation);
 	}
 
-	protected GenericGeneratorAnnotation buildGenericGeneratorAnnotation(int index) {
-		return (GenericGeneratorAnnotation) this.owner.getResourceAnnotatedElement().addAnnotation(index, GenericGeneratorAnnotation.ANNOTATION_NAME, GenericGeneratorsAnnotation.ANNOTATION_NAME);
+	protected GenericGeneratorAnnotation addGenericGeneratorAnnotation(int index) {
+		return (GenericGeneratorAnnotation) this.parentAdapter.getResourceAnnotatedElement().addAnnotation(index, GenericGeneratorAnnotation.ANNOTATION_NAME);
 	}
 
-	@Override
-	public void removeGenericGenerator(GenericGenerator generator) {
-		removeGenericGenerator(this.genericGenerators.indexOf(generator));
+	public void removeGenericGenerator(GenericGenerator genericGenerator) {
+		this.removeGenericGenerator(this.genericGeneratorContainer.indexOfContextElement((JavaGenericGenerator) genericGenerator));
 	}
 
-	@Override
 	public void removeGenericGenerator(int index) {
-		this.owner.getResourceAnnotatedElement().removeAnnotation(index, GenericGeneratorAnnotation.ANNOTATION_NAME, GenericGeneratorsAnnotation.ANNOTATION_NAME);
-		this.removeGenericGenerator_(index);
+		this.parentAdapter.getResourceAnnotatedElement().removeAnnotation(index, GenericGeneratorAnnotation.ANNOTATION_NAME);
+		this.genericGeneratorContainer.removeContextElement(index);
 	}
 
-	/**
-	 * @param index
-	 */
-	protected void removeGenericGenerator_(int index) {
-		this.removeItemFromList(index, this.genericGenerators, GENERIC_GENERATORS_LIST);
-	}
-
-	@Override
 	public void moveGenericGenerator(int targetIndex, int sourceIndex) {
-		this.owner.getResourceAnnotatedElement().moveAnnotation(targetIndex, sourceIndex, GenericGeneratorsAnnotation.ANNOTATION_NAME);
-		this.moveItemInList(targetIndex, sourceIndex, this.genericGenerators, GENERIC_GENERATORS_LIST);
+		this.parentAdapter.getResourceAnnotatedElement().moveAnnotation(targetIndex, sourceIndex, GenericGeneratorAnnotation.ANNOTATION_NAME);
+		this.genericGeneratorContainer.moveContextElement(targetIndex, sourceIndex);
 	}
 
-
-	protected void initializeGenericGenerators() {
-		for (GenericGeneratorAnnotation annotation : this.getGenericGeneratorAnnotations()) {
-			this.genericGenerators.add(this.buildGenericGenerator(annotation));
-		}
-	}
-
 	protected JavaGenericGenerator buildGenericGenerator(GenericGeneratorAnnotation genericGeneratorAnnotation) {
 		return this.getJpaFactory().buildJavaGenericGenerator(this, genericGeneratorAnnotation);
 	}
 
 	protected void syncGenericGenerators() {
-		ContextContainerTools.synchronizeWithResourceModel(this.genericGeneratorsContainerAdapter);
+		this.genericGeneratorContainer.synchronizeWithResourceModel();
 	}
 
-
-	protected Iterable<GenericGeneratorAnnotation> getGenericGeneratorAnnotations() {
-		return new SubIterableWrapper<NestableAnnotation, GenericGeneratorAnnotation>(
-				CollectionTools.iterable(this.genericGeneratorAnnotations())
-			);
+	protected ListIterable<GenericGeneratorAnnotation> getGenericGeneratorAnnotations() {
+		return new SubListIterableWrapper<NestableAnnotation, GenericGeneratorAnnotation>(this.getNestableGenericGeneratorAnnotations_());
 	}
 
-	protected Iterator<NestableAnnotation> genericGeneratorAnnotations() {
-		return this.owner.getResourceAnnotatedElement().annotations(GenericGeneratorAnnotation.ANNOTATION_NAME, GenericGeneratorsAnnotation.ANNOTATION_NAME);
+	protected ListIterable<NestableAnnotation> getNestableGenericGeneratorAnnotations_() {
+		return this.parentAdapter.getResourceAnnotatedElement().getAnnotations(GenericGeneratorAnnotation.ANNOTATION_NAME);
 	}
 
-
-	protected void moveGenericGenerator_(int index, JavaGenericGenerator genericGenerator) {
-		this.moveItemInList(index, genericGenerator, this.genericGenerators, GENERIC_GENERATORS_LIST);
+	protected ContextListContainer<JavaGenericGenerator, GenericGeneratorAnnotation> buildGenericGeneratorContainer() {
+		GenericGeneratorContainer container = new GenericGeneratorContainer();
+		container.initialize();
+		return container;
 	}
 
-	protected JavaGenericGenerator addGenericGenerator_(int index, GenericGeneratorAnnotation ggAnnotation) {
-		JavaGenericGenerator generator = this.buildGenericGenerator(ggAnnotation);
-		this.addItemToList(index, generator, this.genericGenerators, GENERIC_GENERATORS_LIST);
-		return generator;
-	}
-
-	protected void removeGenericGenerator_(JavaGenericGenerator rgenericGenerator) {
-		this.removeGenericGenerator_(this.genericGenerators.indexOf(rgenericGenerator));
-	}
-
-
 	/**
-	 * generic generator container adapter
+	 * generic generator container
 	 */
-	protected class GenericGeneratorContainerAdapter
-		implements ContextContainerTools.Adapter<JavaGenericGenerator, GenericGeneratorAnnotation>
+	protected class GenericGeneratorContainer
+		extends ContextListContainer<JavaGenericGenerator, GenericGeneratorAnnotation>
 	{
 		@Override
-		public Iterable<JavaGenericGenerator> getContextElements() {
-			return HibernateJavaGeneratorContainerImpl.this.getGenericGenerators();
+		protected String getContextElementsPropertyName() {
+			return GENERIC_GENERATORS_LIST;
 		}
 		@Override
-		public Iterable<GenericGeneratorAnnotation> getResourceElements() {
+		protected JavaGenericGenerator buildContextElement(GenericGeneratorAnnotation resourceElement) {
+			return HibernateJavaGeneratorContainerImpl.this.buildGenericGenerator(resourceElement);
+		}
+		@Override
+		protected ListIterable<GenericGeneratorAnnotation> getResourceElements() {
 			return HibernateJavaGeneratorContainerImpl.this.getGenericGeneratorAnnotations();
 		}
 		@Override
-		public GenericGeneratorAnnotation getResourceElement(JavaGenericGenerator contextElement) {
+		protected GenericGeneratorAnnotation getResourceElement(JavaGenericGenerator contextElement) {
 			return contextElement.getGeneratorAnnotation();
 		}
-		@Override
-		public void moveContextElement(int index, JavaGenericGenerator element) {
-			HibernateJavaGeneratorContainerImpl.this.moveGenericGenerator_(index, element);
-		}
-		@Override
-		public void addContextElement(int index, GenericGeneratorAnnotation resourceElement) {
-			HibernateJavaGeneratorContainerImpl.this.addGenericGenerator_(index, resourceElement);
-		}
-		@Override
-		public void removeContextElement(JavaGenericGenerator element) {
-			HibernateJavaGeneratorContainerImpl.this.removeGenericGenerator_(element);
-		}
 	}
 
-	/* (non-Javadoc)
-	 * @see org.eclipse.jpt.jpa.core.internal.jpa1.context.java.GenericJavaGeneratorContainer#javaCompletionProposals(int, org.eclipse.jpt.common.utility.Filter, org.eclipse.jdt.core.dom.CompilationUnit)
-	 */
 	@Override
-	public Iterator<String> javaCompletionProposals(int pos, Filter<String> filter,
+	public Iterable<String> getJavaCompletionProposals(int pos, Filter<String> filter,
 			CompilationUnit astRoot) {
-		Iterator<String> result = super.javaCompletionProposals(pos, filter, astRoot);
+		Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
 		if (result != null) {
 			return result;
 		}
-		ListIterator<JavaGenericGenerator> genericGenerators = genericGenerators();
+		ListIterator<JavaGenericGenerator> genericGenerators = getGenericGenerators().iterator();
 		while (genericGenerators.hasNext()) {
 			result = genericGenerators.next()
-			.javaCompletionProposals(pos, filter, astRoot);
+			.getJavaCompletionProposals(pos, filter, astRoot);
 			if (result != null) {
 				return result;
 			}

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaIdMappingImpl.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaIdMappingImpl.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaIdMappingImpl.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -10,11 +10,9 @@
  ******************************************************************************/
 package org.jboss.tools.hibernate.jpt.core.internal.context.java;
 
-import java.util.Iterator;
 import java.util.List;
 
 import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.utility.Filter;
 import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
 import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaIdMapping;
 import org.eclipse.wst.validation.internal.provisional.core.IMessage;
@@ -104,14 +102,14 @@
 	}
 	
 	protected IndexAnnotation buildIndexAnnotation() {
-		return (IndexAnnotation) this.getResourcePersistentAttribute().addAnnotation(IndexAnnotation.ANNOTATION_NAME);
+		return (IndexAnnotation) this.getResourceAttribute().addAnnotation(IndexAnnotation.ANNOTATION_NAME);
 	}
 	
 	public void removeIndex() {
 		if (getIndex() == null) {
 			throw new IllegalStateException("index does not exist, cannot be removed"); //$NON-NLS-1$
 		}
-		this.getResourcePersistentAttribute().removeAnnotation(IndexAnnotation.ANNOTATION_NAME);
+		this.getResourceAttribute().removeAnnotation(IndexAnnotation.ANNOTATION_NAME);
 		setIndex(null);
 	}
 
@@ -121,7 +119,7 @@
 	}
 	
 	protected IndexAnnotation getIndexAnnotation() {
-		return (IndexAnnotation) this.getResourcePersistentAttribute().getAnnotation(IndexAnnotation.ANNOTATION_NAME);
+		return (IndexAnnotation) this.getResourceAttribute().getAnnotation(IndexAnnotation.ANNOTATION_NAME);
 	}
 	
 	protected JavaIndex buildIndex(IndexAnnotation annotation) {
@@ -168,14 +166,14 @@
 	}
 
 	protected TypeAnnotation buildTypeAnnotation() {
-		return (TypeAnnotation) this.getResourcePersistentAttribute().addAnnotation(TypeAnnotation.ANNOTATION_NAME);
+		return (TypeAnnotation) this.getResourceAttribute().addAnnotation(TypeAnnotation.ANNOTATION_NAME);
 	}
 
 	public void removeType() {
 		if (this.type == null) {
 			throw new IllegalStateException("generated value does not exist"); //$NON-NLS-1$
 		}
-		this.getResourcePersistentAttribute().removeAnnotation(TypeAnnotation.ANNOTATION_NAME);
+		this.getResourceAttribute().removeAnnotation(TypeAnnotation.ANNOTATION_NAME);
 		this.setType(null);
 	}
 
@@ -185,7 +183,7 @@
 	}
 
 	protected TypeAnnotation getTypeAnnotation() {
-		return (TypeAnnotation) this.getResourcePersistentAttribute().getAnnotation(TypeAnnotation.ANNOTATION_NAME);
+		return (TypeAnnotation) this.getResourceAttribute().getAnnotation(TypeAnnotation.ANNOTATION_NAME);
 	}
 
 	protected JavaType buildType(TypeAnnotation generatedValueAnnotation) {

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaJoinColumnImpl.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaJoinColumnImpl.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaJoinColumnImpl.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -15,10 +15,10 @@
 
 import org.eclipse.jpt.jpa.core.context.Entity;
 import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaJoinColumn;
 import org.eclipse.jpt.jpa.core.context.java.JavaJpaContextNode;
+import org.eclipse.jpt.jpa.core.context.java.JavaReadOnlyJoinColumn;
 import org.eclipse.jpt.jpa.core.internal.jpa1.context.java.GenericJavaJoinColumn;
-import org.eclipse.jpt.jpa.core.resource.java.JoinColumnAnnotation;
+import org.eclipse.jpt.jpa.core.resource.java.CompleteJoinColumnAnnotation;
 import org.eclipse.jpt.jpa.db.Column;
 import org.eclipse.jpt.jpa.db.Table;
 import org.eclipse.wst.validation.internal.provisional.core.IMessage;
@@ -36,8 +36,8 @@
 public class HibernateJavaJoinColumnImpl extends GenericJavaJoinColumn
 implements HibernateJavaJoinColumn {
 
-	public HibernateJavaJoinColumnImpl(JavaJpaContextNode parent, JavaJoinColumn.Owner owner, JoinColumnAnnotation columnAnnotation) {
-		super(parent, owner, columnAnnotation);
+	public HibernateJavaJoinColumnImpl(JavaJpaContextNode parent, JavaReadOnlyJoinColumn.Owner owner, CompleteJoinColumnAnnotation joinColumnAnnotation) {
+		super(parent, owner, joinColumnAnnotation);
 	}
 
 	@Override
@@ -52,7 +52,7 @@
 
 	@Override
 	public ReadOnlyPersistentAttribute getReferencedPersistentAttribute() {
-		if (this.owner.joinColumnsSize() != 1) {
+		if (this.owner.getJoinColumnsSize() != 1) {
 			return null;
 		}
 		Entity targetEntity = this.owner.getRelationshipTarget();
@@ -60,7 +60,7 @@
 			return null;
 		}
 		ReadOnlyPersistentAttribute pAttr = null;
-		Iterator<ReadOnlyPersistentAttribute> attributes = targetEntity.getPersistentType().allAttributes();
+		Iterator<ReadOnlyPersistentAttribute> attributes = targetEntity.getPersistentType().getAllAttributes().iterator();
 		for (Iterator<ReadOnlyPersistentAttribute> stream = attributes; stream.hasNext();) {
 			ReadOnlyPersistentAttribute attribute = stream.next();
 			String name = attribute.getPrimaryKeyColumnName();

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaJoinColumnJoiningStrategy.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaJoinColumnJoiningStrategy.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaJoinColumnJoiningStrategy.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -11,8 +11,8 @@
 
 package org.jboss.tools.hibernate.jpt.core.internal.context.java;
 
-import org.eclipse.jpt.jpa.core.context.java.JavaJoinColumn;
 import org.eclipse.jpt.jpa.core.context.java.JavaMappingJoinColumnRelationship;
+import org.eclipse.jpt.jpa.core.context.java.JavaReadOnlyJoinColumn;
 import org.eclipse.jpt.jpa.core.internal.context.java.GenericJavaMappingJoinColumnRelationshipStrategy;
 
 /**
@@ -28,7 +28,7 @@
 	}
 	
 	@Override
-	protected JavaJoinColumn.Owner buildJoinColumnOwner() {
+	protected JavaReadOnlyJoinColumn.Owner buildJoinColumnOwner() {
 		return new HibernateJoinColumnOwner();
 	}
 

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaJoinColumnRelationshipStrategy.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaJoinColumnRelationshipStrategy.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaJoinColumnRelationshipStrategy.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -11,8 +11,8 @@
 
 package org.jboss.tools.hibernate.jpt.core.internal.context.java;
 
-import org.eclipse.jpt.jpa.core.context.java.JavaJoinColumn;
 import org.eclipse.jpt.jpa.core.context.java.JavaMappingJoinColumnRelationship;
+import org.eclipse.jpt.jpa.core.context.java.JavaReadOnlyJoinColumn;
 import org.eclipse.jpt.jpa.core.internal.context.java.GenericJavaMappingJoinColumnRelationshipStrategy;
 
 /**
@@ -26,7 +26,7 @@
 	}
 
 	@Override
-	protected JavaJoinColumn.Owner buildJoinColumnOwner() {
+	protected JavaReadOnlyJoinColumn.Owner buildJoinColumnOwner() {
 		return new HibernateJoinColumnOwner();
 	}
 

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaManyToManyMapping.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaManyToManyMapping.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaManyToManyMapping.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -91,7 +91,7 @@
 		if (getForeignKey() != null) {
 			throw new IllegalStateException("foreignKey already exists"); //$NON-NLS-1$
 		}
-		ForeignKeyAnnotation annotation = (ForeignKeyAnnotation) this.getResourcePersistentAttribute().addAnnotation(ForeignKeyAnnotation.ANNOTATION_NAME);
+		ForeignKeyAnnotation annotation = (ForeignKeyAnnotation) this.getResourceAttribute().addAnnotation(ForeignKeyAnnotation.ANNOTATION_NAME);
 		ForeignKey foreignKey = buildForeignKey(annotation);
 		setForeignKey(foreignKey);
 		return this.foreignKey;
@@ -113,7 +113,7 @@
 		if (getForeignKey() == null) {
 			throw new IllegalStateException("foreignKey does not exist, cannot be removed"); //$NON-NLS-1$
 		}
-		this.getResourcePersistentAttribute().removeAnnotation(ForeignKeyAnnotation.ANNOTATION_NAME);
+		this.getResourceAttribute().removeAnnotation(ForeignKeyAnnotation.ANNOTATION_NAME);
 		setForeignKey(null);
 	}
 	
@@ -127,7 +127,7 @@
 	}
 
 	protected ForeignKeyAnnotation getForeignKeyAnnotation() {
-		return (ForeignKeyAnnotation) this.getResourcePersistentAttribute().getAnnotation(ForeignKeyAnnotation.ANNOTATION_NAME);
+		return (ForeignKeyAnnotation) this.getResourceAttribute().getAnnotation(ForeignKeyAnnotation.ANNOTATION_NAME);
 	}
 
 	public Table getForeignKeyDbTable() {

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaManyToManyRelationship.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaManyToManyRelationship.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaManyToManyRelationship.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -10,9 +10,9 @@
  ******************************************************************************/
 package org.jboss.tools.hibernate.jpt.core.internal.context.java;
 
-import org.eclipse.jpt.jpa.core.context.java.JavaJoinTableRelationshipStrategy;
 import org.eclipse.jpt.jpa.core.context.java.JavaManyToManyMapping;
 import org.eclipse.jpt.jpa.core.internal.context.java.GenericJavaManyToManyRelationship;
+import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaMappingJoinTableRelationshipStrategy2_0;
 
 /**
  * @author Dmitry Geraskov
@@ -29,7 +29,7 @@
 	}
 
 	@Override
-	protected JavaJoinTableRelationshipStrategy buildJoinTableStrategy() {
+	protected JavaMappingJoinTableRelationshipStrategy2_0 buildJoinTableStrategy() {
 		return new HibernateJavaJoinTableRelationshipStrategy(this);
 	}
 

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaManyToManyRelationshipReference.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaManyToManyRelationshipReference.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaManyToManyRelationshipReference.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -10,9 +10,9 @@
   ******************************************************************************/
 package org.jboss.tools.hibernate.jpt.core.internal.context.java;
 
-import org.eclipse.jpt.jpa.core.context.java.JavaJoinTableRelationshipStrategy;
 import org.eclipse.jpt.jpa.core.context.java.JavaManyToManyMapping;
 import org.eclipse.jpt.jpa.core.internal.context.java.GenericJavaManyToManyRelationship;
+import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaMappingJoinTableRelationshipStrategy2_0;
 
 /**
  * @author Dmitry Geraskov
@@ -29,7 +29,7 @@
 		super(parent);
 	}
 	
-	protected JavaJoinTableRelationshipStrategy buildJoinTableStrategy() {
+	protected JavaMappingJoinTableRelationshipStrategy2_0 buildJoinTableStrategy() {
 		return new HibernateJavaJoinTableJoiningStrategy(this);
 	}
 

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaManyToOneMapping.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaManyToOneMapping.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaManyToOneMapping.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -84,7 +84,7 @@
 		if (getForeignKey() != null) {
 			throw new IllegalStateException("foreignKey already exists"); //$NON-NLS-1$
 		}
-		ForeignKeyAnnotation annotation = (ForeignKeyAnnotation) this.getResourcePersistentAttribute().addAnnotation(ForeignKeyAnnotation.ANNOTATION_NAME);
+		ForeignKeyAnnotation annotation = (ForeignKeyAnnotation) this.getResourceAttribute().addAnnotation(ForeignKeyAnnotation.ANNOTATION_NAME);
 		ForeignKey foreignKey = buildForeignKey(annotation);
 		setForeignKey(foreignKey);
 		return this.foreignKey;
@@ -106,7 +106,7 @@
 		if (getForeignKey() == null) {
 			throw new IllegalStateException("foreignKey does not exist, cannot be removed"); //$NON-NLS-1$
 		}
-		this.getResourcePersistentAttribute().removeAnnotation(ForeignKeyAnnotation.ANNOTATION_NAME);
+		this.getResourceAttribute().removeAnnotation(ForeignKeyAnnotation.ANNOTATION_NAME);
 		setForeignKey(null);
 	}
 	
@@ -120,7 +120,7 @@
 	}
 
 	protected ForeignKeyAnnotation getForeignKeyAnnotation() {
-		return (ForeignKeyAnnotation) this.getResourcePersistentAttribute().getAnnotation(ForeignKeyAnnotation.ANNOTATION_NAME);
+		return (ForeignKeyAnnotation) this.getResourceAttribute().getAnnotation(ForeignKeyAnnotation.ANNOTATION_NAME);
 	}
 
 	public Table getForeignKeyDbTable() {

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaManyToOneRelationship.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaManyToOneRelationship.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaManyToOneRelationship.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -11,9 +11,9 @@
 
 package org.jboss.tools.hibernate.jpt.core.internal.context.java;
 
-import org.eclipse.jpt.jpa.core.context.java.JavaJoinColumnRelationshipStrategy;
 import org.eclipse.jpt.jpa.core.context.java.JavaManyToOneMapping;
 import org.eclipse.jpt.jpa.core.internal.context.java.GenericJavaManyToOneRelationship;
+import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaMappingJoinColumnRelationshipStrategy2_0;
 
 /**
  * @author Dmitry Geraskov
@@ -27,7 +27,7 @@
 	}
 
 	@Override
-	protected JavaJoinColumnRelationshipStrategy buildJoinColumnStrategy() {
+	protected JavaMappingJoinColumnRelationshipStrategy2_0 buildJoinColumnStrategy() {
 		return new HibernateJavaJoinColumnRelationshipStrategy(this);
 	}
 

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaManyToOneRelationshipReference.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaManyToOneRelationshipReference.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaManyToOneRelationshipReference.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -11,9 +11,9 @@
 
 package org.jboss.tools.hibernate.jpt.core.internal.context.java;
 
-import org.eclipse.jpt.jpa.core.context.java.JavaJoinColumnRelationshipStrategy;
 import org.eclipse.jpt.jpa.core.context.java.JavaManyToOneMapping;
 import org.eclipse.jpt.jpa.core.internal.context.java.GenericJavaManyToOneRelationship;
+import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaMappingJoinColumnRelationshipStrategy2_0;
 
 /**
  * @author Dmitry Geraskov
@@ -28,7 +28,7 @@
 	}
 	
 	@Override
-	protected JavaJoinColumnRelationshipStrategy buildJoinColumnStrategy() {
+	protected JavaMappingJoinColumnRelationshipStrategy2_0 buildJoinColumnStrategy() {
 		return new HibernateJavaJoinColumnJoiningStrategy(this);
 	}
 

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaOneToManyMapping.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaOneToManyMapping.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaOneToManyMapping.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -92,7 +92,7 @@
 		if (getForeignKey() != null) {
 			throw new IllegalStateException("foreignKey already exists"); //$NON-NLS-1$
 		}
-		ForeignKeyAnnotation annotation = (ForeignKeyAnnotation) this.getResourcePersistentAttribute().addAnnotation(ForeignKeyAnnotation.ANNOTATION_NAME);
+		ForeignKeyAnnotation annotation = (ForeignKeyAnnotation) this.getResourceAttribute().addAnnotation(ForeignKeyAnnotation.ANNOTATION_NAME);
 		ForeignKey foreignKey = buildForeignKey(annotation);
 		setForeignKey(foreignKey);
 		return this.foreignKey;
@@ -114,7 +114,7 @@
 		if (getForeignKey() == null) {
 			throw new IllegalStateException("foreignKey does not exist, cannot be removed"); //$NON-NLS-1$
 		}
-		this.getResourcePersistentAttribute().removeAnnotation(ForeignKeyAnnotation.ANNOTATION_NAME);
+		this.getResourceAttribute().removeAnnotation(ForeignKeyAnnotation.ANNOTATION_NAME);
 		setForeignKey(null);
 	}
 	
@@ -128,7 +128,7 @@
 	}
 
 	protected ForeignKeyAnnotation getForeignKeyAnnotation() {
-		return (ForeignKeyAnnotation) this.getResourcePersistentAttribute().getAnnotation(ForeignKeyAnnotation.ANNOTATION_NAME);
+		return (ForeignKeyAnnotation) this.getResourceAttribute().getAnnotation(ForeignKeyAnnotation.ANNOTATION_NAME);
 	}
 
 	public Table getForeignKeyDbTable() {

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaOneToManyRelationship.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaOneToManyRelationship.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaOneToManyRelationship.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -10,9 +10,9 @@
  ******************************************************************************/
 package org.jboss.tools.hibernate.jpt.core.internal.context.java;
 
-import org.eclipse.jpt.jpa.core.context.java.JavaJoinTableRelationshipStrategy;
 import org.eclipse.jpt.jpa.core.context.java.JavaOneToManyMapping;
 import org.eclipse.jpt.jpa.core.internal.context.java.GenericJavaOneToManyRelationship;
+import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaMappingJoinTableRelationshipStrategy2_0;
 
 /**
  * @author Dmitry Geraskov
@@ -29,7 +29,7 @@
 	}
 
 	@Override
-	protected JavaJoinTableRelationshipStrategy buildJoinTableStrategy() {
+	protected JavaMappingJoinTableRelationshipStrategy2_0 buildJoinTableStrategy() {
 		return new HibernateJavaJoinTableRelationshipStrategy(this);
 	}
 

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaOneToManyRelationshipReference.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaOneToManyRelationshipReference.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaOneToManyRelationshipReference.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -10,7 +10,6 @@
   ******************************************************************************/
 package org.jboss.tools.hibernate.jpt.core.internal.context.java;
 
-import org.eclipse.jpt.jpa.core.context.java.JavaJoinColumnRelationshipStrategy;
 import org.eclipse.jpt.jpa.core.context.java.JavaOneToManyMapping;
 import org.eclipse.jpt.jpa.core.internal.context.java.GenericJavaOneToManyRelationship;
 

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaOneToOneMapping.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaOneToOneMapping.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaOneToOneMapping.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -83,7 +83,7 @@
 		if (getForeignKey() != null) {
 			throw new IllegalStateException("foreignKey already exists"); //$NON-NLS-1$
 		}
-		ForeignKeyAnnotation annotation = (ForeignKeyAnnotation) this.getResourcePersistentAttribute().addAnnotation(ForeignKeyAnnotation.ANNOTATION_NAME);
+		ForeignKeyAnnotation annotation = (ForeignKeyAnnotation) this.getResourceAttribute().addAnnotation(ForeignKeyAnnotation.ANNOTATION_NAME);
 		ForeignKey foreignKey = buildForeignKey(annotation);
 		setForeignKey(foreignKey);
 		return this.foreignKey;
@@ -105,7 +105,7 @@
 		if (getForeignKey() == null) {
 			throw new IllegalStateException("foreignKey does not exist, cannot be removed"); //$NON-NLS-1$
 		}
-		this.getResourcePersistentAttribute().removeAnnotation(ForeignKeyAnnotation.ANNOTATION_NAME);
+		this.getResourceAttribute().removeAnnotation(ForeignKeyAnnotation.ANNOTATION_NAME);
 		setForeignKey(null);
 	}
 	
@@ -119,7 +119,7 @@
 	}
 
 	protected ForeignKeyAnnotation getForeignKeyAnnotation() {
-		return (ForeignKeyAnnotation) this.getResourcePersistentAttribute().getAnnotation(ForeignKeyAnnotation.ANNOTATION_NAME);
+		return (ForeignKeyAnnotation) this.getResourceAttribute().getAnnotation(ForeignKeyAnnotation.ANNOTATION_NAME);
 	}
 
 	public Table getForeignKeyDbTable() {

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaOneToOneRelationship.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaOneToOneRelationship.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaOneToOneRelationship.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -11,9 +11,9 @@
 
 package org.jboss.tools.hibernate.jpt.core.internal.context.java;
 
-import org.eclipse.jpt.jpa.core.context.java.JavaJoinColumnRelationshipStrategy;
 import org.eclipse.jpt.jpa.core.context.java.JavaOneToOneMapping;
 import org.eclipse.jpt.jpa.core.internal.context.java.GenericJavaOneToOneRelationship;
+import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaMappingJoinColumnRelationshipStrategy2_0;
 
 /**
  * @author Dmitry Geraskov
@@ -26,7 +26,7 @@
 	}
 
 	@Override
-	protected JavaJoinColumnRelationshipStrategy buildJoinColumnStrategy() {
+	protected JavaMappingJoinColumnRelationshipStrategy2_0 buildJoinColumnStrategy() {
 		return new HibernateJavaJoinColumnRelationshipStrategy(this);
 	}
 

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaQueryContainer.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaQueryContainer.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaQueryContainer.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -10,8 +10,7 @@
  ******************************************************************************/
 package org.jboss.tools.hibernate.jpt.core.internal.context.java;
 
-import java.util.ListIterator;
-
+import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
 import org.eclipse.jpt.jpa.core.context.java.JavaQueryContainer;
 import org.jboss.tools.hibernate.jpt.core.internal.context.HibernateNamedNativeQuery;
 import org.jboss.tools.hibernate.jpt.core.internal.context.HibernateNamedQuery;
@@ -24,9 +23,9 @@
 public interface HibernateJavaQueryContainer extends JavaQueryContainer {
 
 	//********** Hibernate Named Queries **************
-	ListIterator<HibernateJavaNamedQuery> hibernateNamedQueries();
+	ListIterable<HibernateJavaNamedQuery> getHibernateNamedQueries();
 
-	int hibernateNamedQueriesSize();
+	int getHibernateNamedQueriesSize();
 
 	HibernateNamedQuery addHibernateNamedQuery(int index);
 
@@ -42,9 +41,9 @@
 
 	//********** Hibernate Named Native Queries **************;
 
-	ListIterator<HibernateJavaNamedNativeQuery> hibernateNamedNativeQueries();
+	ListIterable<HibernateJavaNamedNativeQuery> getHibernateNamedNativeQueries();
 
-	int hibernateNamedNativeQueriesSize();
+	int getHibernateNamedNativeQueriesSize();
 
 	HibernateJavaNamedNativeQuery addHibernateNamedNativeQuery(int index);
 

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaQueryContainerImpl.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaQueryContainerImpl.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaQueryContainerImpl.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -10,24 +10,17 @@
  ******************************************************************************/
 package org.jboss.tools.hibernate.jpt.core.internal.context.java;
 
-import java.util.Iterator;
-import java.util.ListIterator;
-import java.util.Vector;
-
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
+import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
+import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
 import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SubIterableWrapper;
+import org.eclipse.jpt.common.utility.internal.iterables.SubListIterableWrapper;
+import org.eclipse.jpt.jpa.core.context.Query;
 import org.eclipse.jpt.jpa.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.jpa.core.internal.context.ContextContainerTools;
 import org.eclipse.jpt.jpa.core.internal.jpa1.context.java.GenericJavaQueryContainer;
-import org.eclipse.jpt.jpa.core.resource.java.NestableAnnotation;
 import org.jboss.tools.hibernate.jpt.core.internal.HibernateAbstractJpaFactory;
 import org.jboss.tools.hibernate.jpt.core.internal.context.HibernateNamedNativeQuery;
 import org.jboss.tools.hibernate.jpt.core.internal.context.HibernateNamedQuery;
-import org.jboss.tools.hibernate.jpt.core.internal.resource.java.HibernateNamedNativeQueriesAnnotation;
 import org.jboss.tools.hibernate.jpt.core.internal.resource.java.HibernateNamedNativeQueryAnnotation;
-import org.jboss.tools.hibernate.jpt.core.internal.resource.java.HibernateNamedQueriesAnnotation;
 import org.jboss.tools.hibernate.jpt.core.internal.resource.java.HibernateNamedQueryAnnotation;
 
 /**
@@ -38,17 +31,14 @@
 public class HibernateJavaQueryContainerImpl extends GenericJavaQueryContainer
 implements HibernateJavaQueryContainer{
 
-	protected final Vector<HibernateJavaNamedQuery> hibernateNamedQueries = new Vector<HibernateJavaNamedQuery>();
-	protected HibernateNamedQueryContainerAdapter hibernateNamedQueryContainerAdapter = new HibernateNamedQueryContainerAdapter();
+	
+	protected final ContextListContainer<HibernateJavaNamedQuery, HibernateNamedQueryAnnotation> hibernateNamedQueryContainer;
+	protected final ContextListContainer<HibernateJavaNamedNativeQuery, HibernateNamedNativeQueryAnnotation> hibernateNamedNativeQueryContainer;
 
-	protected final Vector<HibernateJavaNamedNativeQuery> hibernateNamedNativeQueries = new Vector<HibernateJavaNamedNativeQuery>();
-	protected HibernateNamedNativeQueryContainerAdapter hibernateNamedNativeQueryContainerAdapter = new HibernateNamedNativeQueryContainerAdapter();
-
-
 	public HibernateJavaQueryContainerImpl(JavaJpaContextNode parent, Owner owner) {
 		super(parent, owner);
-		this.initializeHibernateNamedQueries();
-		this.initializeHibernateNamedNativeQueries();
+		this.hibernateNamedQueryContainer = this.buildHibernateNamedQueryContainer();
+		this.hibernateNamedNativeQueryContainer = this.buildHibernateNamedNativeQueryContainer();
 	}
 
 	@Override
@@ -72,224 +62,194 @@
 		this.updateNodes(this.getHibernateNamedQueries());
 		this.updateNodes(this.getHibernateNamedNativeQueries());
 	}
+	
+	// ********** queries **********
 
+	@SuppressWarnings("unchecked")
+	public Iterable<Query> getQueries() {
+		return new CompositeIterable<Query>(super.getQueries(),
+				this.getHibernateNamedQueries(), this.getHibernateNamedNativeQueries());
+	}
 
 	// ********** hibernateNamed queries **********
-
-	public ListIterator<HibernateJavaNamedQuery> hibernateNamedQueries() {
-		return this.getHibernateNamedQueries().iterator();
+	@Override
+	public ListIterable<HibernateJavaNamedQuery> getHibernateNamedQueries() {
+		return this.hibernateNamedQueryContainer.getContextElements();
 	}
 
-	protected ListIterable<HibernateJavaNamedQuery> getHibernateNamedQueries() {
-		return new LiveCloneListIterable<HibernateJavaNamedQuery>(this.hibernateNamedQueries);
+	@Override
+	public int getHibernateNamedQueriesSize() {
+		return this.hibernateNamedQueryContainer.getContextElementsSize();
 	}
 
-	public int hibernateNamedQueriesSize() {
-		return this.hibernateNamedQueries.size();
-	}
-
 	public HibernateNamedQuery addHibernateNamedQuery() {
-		return this.addHibernateNamedQuery(this.hibernateNamedQueries.size());
+		return this.addHibernateNamedQuery(this.getNamedQueriesSize());
 	}
 
+	@Override
 	public HibernateJavaNamedQuery addHibernateNamedQuery(int index) {
-		HibernateNamedQueryAnnotation annotation = this.buildHibernateNamedQueryAnnotation(index);
-		return this.addHibernateNamedQuery_(index, annotation);
+		HibernateNamedQueryAnnotation annotation = this.addHibernateNamedQueryAnnotation(index);
+		return this.hibernateNamedQueryContainer.addContextElement(index, annotation);
 	}
 
-	protected HibernateNamedQueryAnnotation buildHibernateNamedQueryAnnotation(int index) {
-		return (HibernateNamedQueryAnnotation) this.owner.getResourceAnnotatedElement().addAnnotation(index, HibernateNamedQueryAnnotation.ANNOTATION_NAME, HibernateNamedQueriesAnnotation.ANNOTATION_NAME);
+	protected HibernateNamedQueryAnnotation addHibernateNamedQueryAnnotation(int index) {
+		return (HibernateNamedQueryAnnotation) this.owner.getResourceAnnotatedElement().addAnnotation(index, HibernateNamedQueryAnnotation.ANNOTATION_NAME);
 	}
 
+	@Override
 	public void removeHibernateNamedQuery(HibernateNamedQuery hibernateNamedQuery) {
-		this.removeHibernateNamedQuery(this.hibernateNamedQueries.indexOf(hibernateNamedQuery));
+		this.removeHibernateNamedQuery(this.hibernateNamedQueryContainer.indexOfContextElement((HibernateJavaNamedQuery) hibernateNamedQuery));
 	}
 
+	@Override
 	public void removeHibernateNamedQuery(int index) {
-		this.owner.getResourceAnnotatedElement().removeAnnotation(index, HibernateNamedQueryAnnotation.ANNOTATION_NAME, HibernateNamedQueriesAnnotation.ANNOTATION_NAME);
-		this.removeHibernateNamedQuery_(index);
+		this.owner.getResourceAnnotatedElement().removeAnnotation(index, HibernateNamedQueryAnnotation.ANNOTATION_NAME);
+		this.hibernateNamedQueryContainer.removeContextElement(index);
 	}
 
-	protected void removeHibernateNamedQuery_(int index) {
-		this.removeItemFromList(index, this.hibernateNamedQueries, HIBERNATE_NAMED_QUERIES_LIST);
-	}
-
+	@Override
 	public void moveHibernateNamedQuery(int targetIndex, int sourceIndex) {
-		this.owner.getResourceAnnotatedElement().moveAnnotation(targetIndex, sourceIndex, HibernateNamedQueriesAnnotation.ANNOTATION_NAME);
-		this.moveItemInList(targetIndex, sourceIndex, this.hibernateNamedQueries, HIBERNATE_NAMED_QUERIES_LIST);
+		this.owner.getResourceAnnotatedElement().moveAnnotation(targetIndex, sourceIndex, HibernateNamedQueryAnnotation.ANNOTATION_NAME);
+		this.hibernateNamedQueryContainer.moveContextElement(targetIndex, sourceIndex);
 	}
 
-	protected void initializeHibernateNamedQueries() {
-		for (HibernateNamedQueryAnnotation annotation : this.getHibernateNamedQueryAnnotations()) {
-			this.hibernateNamedQueries.add(this.buildHibernateNamedQuery(annotation));
-		}
-	}
-
 	protected HibernateJavaNamedQuery buildHibernateNamedQuery(HibernateNamedQueryAnnotation hibernateNamedQueryAnnotation) {
 		return this.getJpaFactory().buildHibernateJavaNamedQuery(this, hibernateNamedQueryAnnotation);
 	}
 
 	protected void syncHibernateNamedQueries() {
-		ContextContainerTools.synchronizeWithResourceModel(this.hibernateNamedQueryContainerAdapter);
+		this.hibernateNamedQueryContainer.synchronizeWithResourceModel();
 	}
 
-	protected Iterable<HibernateNamedQueryAnnotation> getHibernateNamedQueryAnnotations() {
-		return new SubIterableWrapper<NestableAnnotation, HibernateNamedQueryAnnotation>(
-				CollectionTools.iterable(this.hibernateNamedQueryAnnotations())
+	protected ListIterable<HibernateNamedQueryAnnotation> getHibernateNamedQueryAnnotations() {
+		return new SubListIterableWrapper<NestableAnnotation, HibernateNamedQueryAnnotation>(
+				this.getNestableHibernateNamedQueryAnnotations_()
 			);
 	}
 
-	protected Iterator<NestableAnnotation> hibernateNamedQueryAnnotations() {
-		return this.owner.getResourceAnnotatedElement().annotations(HibernateNamedQueryAnnotation.ANNOTATION_NAME, HibernateNamedQueriesAnnotation.ANNOTATION_NAME);
+	protected ListIterable<NestableAnnotation> getNestableHibernateNamedQueryAnnotations_() {
+		return this.owner.getResourceAnnotatedElement().getAnnotations(HibernateNamedQueryAnnotation.ANNOTATION_NAME);
 	}
-
-	protected void moveHibernateNamedQuery_(int index, HibernateJavaNamedQuery hibernateNamedQuery) {
-		this.moveItemInList(index, hibernateNamedQuery, this.hibernateNamedQueries, HIBERNATE_NAMED_QUERIES_LIST);
+	
+	protected ContextListContainer<HibernateJavaNamedQuery, HibernateNamedQueryAnnotation> buildHibernateNamedQueryContainer() {
+		HibernateNamedQueryContainerAdapter container = new HibernateNamedQueryContainerAdapter();
+		container.initialize();
+		return container;
 	}
 
-	protected HibernateJavaNamedQuery addHibernateNamedQuery_(int index, HibernateNamedQueryAnnotation hibernateNamedQueryAnnotation) {
-		HibernateJavaNamedQuery query = this.buildHibernateNamedQuery(hibernateNamedQueryAnnotation);
-		this.addItemToList(index, query, this.hibernateNamedQueries, HIBERNATE_NAMED_QUERIES_LIST);
-		return query;
-	}
-
-	protected void removeHibernateNamedQuery_(HibernateNamedQuery hibernateNamedQuery) {
-		this.removeHibernateNamedQuery_(this.hibernateNamedQueries.indexOf(hibernateNamedQuery));
-	}
-
 	/**
 	 * hibernateNamed query container adapter
 	 */
 	protected class HibernateNamedQueryContainerAdapter
-		implements ContextContainerTools.Adapter<HibernateJavaNamedQuery, HibernateNamedQueryAnnotation>
+		extends ContextListContainer<HibernateJavaNamedQuery, HibernateNamedQueryAnnotation>
 	{
-		public Iterable<HibernateJavaNamedQuery> getContextElements() {
-			return HibernateJavaQueryContainerImpl.this.getHibernateNamedQueries();
+		@Override
+		protected String getContextElementsPropertyName() {
+			return HIBERNATE_NAMED_QUERIES_LIST;
 		}
-		public Iterable<HibernateNamedQueryAnnotation> getResourceElements() {
+		@Override
+		protected HibernateJavaNamedQuery buildContextElement(HibernateNamedQueryAnnotation resourceElement) {
+			return HibernateJavaQueryContainerImpl.this.buildHibernateNamedQuery(resourceElement);
+		}
+		@Override
+		protected ListIterable<HibernateNamedQueryAnnotation> getResourceElements() {
 			return HibernateJavaQueryContainerImpl.this.getHibernateNamedQueryAnnotations();
 		}
-		public HibernateNamedQueryAnnotation getResourceElement(HibernateJavaNamedQuery contextElement) {
+		@Override
+		protected HibernateNamedQueryAnnotation getResourceElement(HibernateJavaNamedQuery contextElement) {
 			return contextElement.getQueryAnnotation();
 		}
-		public void moveContextElement(int index, HibernateJavaNamedQuery element) {
-			HibernateJavaQueryContainerImpl.this.moveHibernateNamedQuery_(index, element);
-		}
-		public void addContextElement(int index, HibernateNamedQueryAnnotation resourceElement) {
-			HibernateJavaQueryContainerImpl.this.addHibernateNamedQuery_(index, resourceElement);
-		}
-		public void removeContextElement(HibernateJavaNamedQuery element) {
-			HibernateJavaQueryContainerImpl.this.removeHibernateNamedQuery_(element);
-		}
+		
 	}
 
 	// ********** hibernateNamed native queries **********
-
-	public ListIterator<HibernateJavaNamedNativeQuery> hibernateNamedNativeQueries() {
-		return this.getHibernateNamedNativeQueries().iterator();
+	@Override
+	public ListIterable<HibernateJavaNamedNativeQuery> getHibernateNamedNativeQueries() {
+		return this.hibernateNamedNativeQueryContainer.getContextElements();
 	}
 
-	protected ListIterable<HibernateJavaNamedNativeQuery> getHibernateNamedNativeQueries() {
-		return new LiveCloneListIterable<HibernateJavaNamedNativeQuery>(this.hibernateNamedNativeQueries);
+	@Override
+	public int getHibernateNamedNativeQueriesSize() {
+		return this.hibernateNamedNativeQueryContainer.getContextElementsSize();
 	}
 
-	public int hibernateNamedNativeQueriesSize() {
-		return this.hibernateNamedNativeQueries.size();
-	}
-
 	public HibernateNamedNativeQuery addHibernateNamedNativeQuery() {
-		return this.addHibernateNamedNativeQuery(this.hibernateNamedNativeQueries.size());
+		return this.addHibernateNamedNativeQuery(this.getNamedQueriesSize());
 	}
 
+	@Override
 	public HibernateJavaNamedNativeQuery addHibernateNamedNativeQuery(int index) {
-		HibernateNamedNativeQueryAnnotation annotation = this.buildHibernateNamedNativeQueryAnnotation(index);
-		return this.addHibernateNamedNativeQuery_(index, annotation);
+		HibernateNamedNativeQueryAnnotation annotation = this.addHibernateNamedNativeQueryAnnotation(index);
+		return this.hibernateNamedNativeQueryContainer.addContextElement(index, annotation);
 	}
 
-	protected HibernateNamedNativeQueryAnnotation buildHibernateNamedNativeQueryAnnotation(int index) {
-		return (HibernateNamedNativeQueryAnnotation) this.owner.getResourceAnnotatedElement().addAnnotation(index, HibernateNamedNativeQueryAnnotation.ANNOTATION_NAME, HibernateNamedNativeQueriesAnnotation.ANNOTATION_NAME);
+	protected HibernateNamedNativeQueryAnnotation addHibernateNamedNativeQueryAnnotation(int index) {
+		return (HibernateNamedNativeQueryAnnotation) this.owner.getResourceAnnotatedElement().addAnnotation(index, HibernateNamedNativeQueryAnnotation.ANNOTATION_NAME);
 	}
 
+	@Override
 	public void removeHibernateNamedNativeQuery(HibernateNamedNativeQuery hibernateNamedNativeQuery) {
-		this.removeHibernateNamedNativeQuery(this.hibernateNamedNativeQueries.indexOf(hibernateNamedNativeQuery));
+		this.removeHibernateNamedNativeQuery(this.hibernateNamedNativeQueryContainer.indexOfContextElement((HibernateJavaNamedNativeQuery) hibernateNamedNativeQuery));
 	}
 
+	@Override
 	public void removeHibernateNamedNativeQuery(int index) {
-		this.owner.getResourceAnnotatedElement().removeAnnotation(index, HibernateNamedNativeQueryAnnotation.ANNOTATION_NAME, HibernateNamedNativeQueriesAnnotation.ANNOTATION_NAME);
-		this.removeHibernateNamedNativeQuery_(index);
+		this.owner.getResourceAnnotatedElement().removeAnnotation(index, HibernateNamedNativeQueryAnnotation.ANNOTATION_NAME);
+		this.hibernateNamedNativeQueryContainer.removeContextElement(index);
 	}
 
-	protected void removeHibernateNamedNativeQuery_(int index) {
-		this.removeItemFromList(index, this.hibernateNamedNativeQueries, HIBERNATE_NAMED_NATIVE_QUERIES_LIST);
-	}
-
+	@Override
 	public void moveHibernateNamedNativeQuery(int targetIndex, int sourceIndex) {
-		this.owner.getResourceAnnotatedElement().moveAnnotation(targetIndex, sourceIndex, HibernateNamedNativeQueriesAnnotation.ANNOTATION_NAME);
-		this.moveItemInList(targetIndex, sourceIndex, this.hibernateNamedNativeQueries, HIBERNATE_NAMED_NATIVE_QUERIES_LIST);
+		this.owner.getResourceAnnotatedElement().moveAnnotation(targetIndex, sourceIndex, HibernateNamedNativeQueryAnnotation.ANNOTATION_NAME);
+		this.hibernateNamedNativeQueryContainer.moveContextElement(targetIndex, sourceIndex);
 	}
 
-	protected void initializeHibernateNamedNativeQueries() {
-		for (HibernateNamedNativeQueryAnnotation annotation : this.getHibernateNamedNativeQueryAnnotations()) {
-			this.hibernateNamedNativeQueries.add(this.buildHibernateNamedNativeQuery(annotation));
-		}
-	}
-
 	protected HibernateJavaNamedNativeQuery buildHibernateNamedNativeQuery(HibernateNamedNativeQueryAnnotation hibernateNamedNativeQueryAnnotation) {
 		return this.getJpaFactory().buildHibernateJavaNamedNativeQuery(this, hibernateNamedNativeQueryAnnotation);
 	}
 
 	protected void syncHibernateNamedNativeQueries() {
-		ContextContainerTools.synchronizeWithResourceModel(this.hibernateNamedNativeQueryContainerAdapter);
+		this.hibernateNamedNativeQueryContainer.synchronizeWithResourceModel();
 	}
 
-	protected Iterable<HibernateNamedNativeQueryAnnotation> getHibernateNamedNativeQueryAnnotations() {
-		return new SubIterableWrapper<NestableAnnotation, HibernateNamedNativeQueryAnnotation>(
-				CollectionTools.iterable(this.hibernateNamedNativeQueryAnnotations())
+	protected ListIterable<HibernateNamedNativeQueryAnnotation> getHibernateNamedNativeQueryAnnotations() {
+		return new SubListIterableWrapper<NestableAnnotation, HibernateNamedNativeQueryAnnotation>(
+				this.getNestableHibernateNamedNativeQueryAnnotations_()
 			);
 	}
 
-	protected Iterator<NestableAnnotation> hibernateNamedNativeQueryAnnotations() {
-		return this.owner.getResourceAnnotatedElement().annotations(HibernateNamedNativeQueryAnnotation.ANNOTATION_NAME, HibernateNamedNativeQueriesAnnotation.ANNOTATION_NAME);
+	protected ListIterable<NestableAnnotation> getNestableHibernateNamedNativeQueryAnnotations_() {
+		return this.owner.getResourceAnnotatedElement().getAnnotations(HibernateNamedNativeQueryAnnotation.ANNOTATION_NAME);
 	}
-
-	protected void moveHibernateNamedNativeQuery_(int index, HibernateJavaNamedNativeQuery hibernateNamedNativeQuery) {
-		this.moveItemInList(index, hibernateNamedNativeQuery, this.hibernateNamedNativeQueries, HIBERNATE_NAMED_NATIVE_QUERIES_LIST);
+	
+	protected ContextListContainer<HibernateJavaNamedNativeQuery, HibernateNamedNativeQueryAnnotation> buildHibernateNamedNativeQueryContainer() {
+		HibernateNamedNativeQueryContainerAdapter container = new HibernateNamedNativeQueryContainerAdapter();
+		container.initialize();
+		return container;
 	}
 
-	protected HibernateJavaNamedNativeQuery addHibernateNamedNativeQuery_(int index, HibernateNamedNativeQueryAnnotation hibernateNamedNativeQueryAnnotation) {
-		HibernateJavaNamedNativeQuery query = this.buildHibernateNamedNativeQuery(hibernateNamedNativeQueryAnnotation);
-		this.addItemToList(index, query, this.hibernateNamedNativeQueries, HIBERNATE_NAMED_NATIVE_QUERIES_LIST);
-		return query;
-	}
-
-	protected void removeHibernateNamedNativeQuery_(HibernateNamedNativeQuery hibernateNamedNativeQuery) {
-		this.removeHibernateNamedNativeQuery_(this.hibernateNamedNativeQueries.indexOf(hibernateNamedNativeQuery));
-	}
-
 	/**
 	 * hibernateNamed native query container adapter
 	 */
 	protected class HibernateNamedNativeQueryContainerAdapter
-		implements ContextContainerTools.Adapter<HibernateJavaNamedNativeQuery, HibernateNamedNativeQueryAnnotation>
+		extends ContextListContainer<HibernateJavaNamedNativeQuery, HibernateNamedNativeQueryAnnotation>
 	{
-		public Iterable<HibernateJavaNamedNativeQuery> getContextElements() {
-			return HibernateJavaQueryContainerImpl.this.getHibernateNamedNativeQueries();
+		@Override
+		protected String getContextElementsPropertyName() {
+			return HIBERNATE_NAMED_NATIVE_QUERIES_LIST;
 		}
-		public Iterable<HibernateNamedNativeQueryAnnotation> getResourceElements() {
+		@Override
+		protected HibernateJavaNamedNativeQuery buildContextElement(HibernateNamedNativeQueryAnnotation resourceElement) {
+			return HibernateJavaQueryContainerImpl.this.buildHibernateNamedNativeQuery(resourceElement);
+		}
+		@Override
+		protected ListIterable<HibernateNamedNativeQueryAnnotation> getResourceElements() {
 			return HibernateJavaQueryContainerImpl.this.getHibernateNamedNativeQueryAnnotations();
 		}
-		public HibernateNamedNativeQueryAnnotation getResourceElement(HibernateJavaNamedNativeQuery contextElement) {
+		@Override
+		protected HibernateNamedNativeQueryAnnotation getResourceElement(HibernateJavaNamedNativeQuery contextElement) {
 			return contextElement.getQueryAnnotation();
 		}
-		public void moveContextElement(int index, HibernateJavaNamedNativeQuery element) {
-			HibernateJavaQueryContainerImpl.this.moveHibernateNamedNativeQuery_(index, element);
-		}
-		public void addContextElement(int index, HibernateNamedNativeQueryAnnotation resourceElement) {
-			HibernateJavaQueryContainerImpl.this.addHibernateNamedNativeQuery_(index, resourceElement);
-		}
-		public void removeContextElement(HibernateJavaNamedNativeQuery element) {
-			HibernateJavaQueryContainerImpl.this.removeHibernateNamedNativeQuery_(element);
-		}
 	}
 
 }

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaTypeDefContainer.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaTypeDefContainer.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaTypeDefContainer.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -10,8 +10,7 @@
  ******************************************************************************/
 package org.jboss.tools.hibernate.jpt.core.internal.context.java;
 
-import java.util.ListIterator;
-
+import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
 import org.eclipse.jpt.jpa.core.context.java.JavaJpaContextNode;
 
 /**
@@ -28,12 +27,12 @@
 	 * Return a list iterator of the typeDefs.
 	 * This will not be null.
 	 */
-	ListIterator<JavaTypeDef> typeDefs();
+	ListIterable<JavaTypeDef> getTypeDefs();
 	
 	/**
 	 * Return the number of typeDefs.
 	 */
-	int typeDefsSize();
+	int getTypeDefsSize();
 
 	/**
 	 * Add a typeDef to the entity return the object representing it.

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaTypeDefContainerImpl.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaTypeDefContainerImpl.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaTypeDefContainerImpl.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -10,28 +10,20 @@
  ******************************************************************************/
 package org.jboss.tools.hibernate.jpt.core.internal.context.java;
 
-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.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
+import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
 import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
 import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneListIterable;
-import org.eclipse.jpt.common.utility.internal.iterators.SubIteratorWrapper;
-import org.eclipse.jpt.common.utility.internal.iterators.SuperIteratorWrapper;
+import org.eclipse.jpt.common.utility.internal.iterables.SubListIterableWrapper;
 import org.eclipse.jpt.jpa.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.jpa.core.internal.context.ContextContainerTools;
 import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaJpaContextNode;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jpa.core.resource.java.NestableAnnotation;
 import org.eclipse.wst.validation.internal.provisional.core.IMessage;
 import org.eclipse.wst.validation.internal.provisional.core.IReporter;
 import org.jboss.tools.hibernate.jpt.core.internal.HibernateAbstractJpaFactory;
 import org.jboss.tools.hibernate.jpt.core.internal.resource.java.TypeDefAnnotation;
-import org.jboss.tools.hibernate.jpt.core.internal.resource.java.TypeDefsAnnotation;
 
 /**
  * @author Dmitry Geraskov
@@ -40,16 +32,14 @@
 public class HibernateJavaTypeDefContainerImpl extends
 		AbstractJavaJpaContextNode implements HibernateJavaTypeDefContainer {
 
-	protected JavaResourceAnnotatedElement javaResourcePersistentElement;
+	protected JavaResourceAnnotatedElement javaResourceannotatedElement;
 	
-	protected final Vector<JavaTypeDef> typeDefs = new Vector<JavaTypeDef>();
-	protected TypeDefContainerAdapter typeDefContainerAdapter = new TypeDefContainerAdapter();
+	protected final ContextListContainer<JavaTypeDef, TypeDefAnnotation> typeDefContainer;
 
-	
 	public HibernateJavaTypeDefContainerImpl(JavaJpaContextNode parent, JavaResourceAnnotatedElement javaResourcePersistentElement) {
 		super(parent);
-		this.javaResourcePersistentElement = javaResourcePersistentElement;
-		this.initializeTypeDefs();
+		this.javaResourceannotatedElement = javaResourcePersistentElement;
+		this.typeDefContainer = this.buildTypeDefContainer();
 	}
 	
 	public HibernateAbstractJpaFactory getJpaFactory(){
@@ -57,7 +47,7 @@
 	}
 
 	protected JavaResourceAnnotatedElement getResourceAnnotatedElement() {
-		return this.javaResourcePersistentElement;
+		return this.javaResourceannotatedElement;
 	}
 	
 	// ********** synchronize/update **********
@@ -75,128 +65,99 @@
 	}
 
 	// ********** type defs **********
-
-	public ListIterator<JavaTypeDef> typeDefs() {
-		return this.getTypeDefs().iterator();
+	public ListIterable<JavaTypeDef> getTypeDefs() {
+		return this.typeDefContainer.getContextElements();
 	}
 
-	protected ListIterable<JavaTypeDef> getTypeDefs() {
-		return new LiveCloneListIterable<JavaTypeDef>(this.typeDefs);
+	public int getTypeDefsSize() {
+		return this.typeDefContainer.getContextElementsSize();
 	}
 
-	public int typeDefsSize() {
-		return this.typeDefs.size();
-	}
-
 	public JavaTypeDef addTypeDef() {
-		return this.addTypeDef(this.typeDefs.size());
+		return this.addTypeDef(this.getTypeDefsSize());
 	}
 
 	public JavaTypeDef addTypeDef(int index) {
-		TypeDefAnnotation annotation = this.buildTypeDefAnnotation(index);
-		return this.addTypeDef_(index, annotation);
+		TypeDefAnnotation annotation = this.addTypeDefAnnotation(index);
+		return this.typeDefContainer.addContextElement(index, annotation);
 	}
 
-	protected TypeDefAnnotation buildTypeDefAnnotation(int index) {
-		return (TypeDefAnnotation) this.getResourceAnnotatedElement().addAnnotation(index, TypeDefAnnotation.ANNOTATION_NAME, TypeDefsAnnotation.ANNOTATION_NAME);
+	protected TypeDefAnnotation addTypeDefAnnotation(int index) {
+		return (TypeDefAnnotation) this.javaResourceannotatedElement.addAnnotation(index, TypeDefAnnotation.ANNOTATION_NAME);
 	}
 
-	public void removeTypeDef(JavaTypeDef typeDef) {
-		this.removeTypeDef(this.typeDefs.indexOf(typeDef));
+	public void removeTypeDef(JavaTypeDef namedQuery) {
+		this.removeTypeDef(this.typeDefContainer.indexOfContextElement((JavaTypeDef) namedQuery));
 	}
 
 	public void removeTypeDef(int index) {
-		this.getResourceAnnotatedElement().removeAnnotation(index, TypeDefAnnotation.ANNOTATION_NAME, TypeDefsAnnotation.ANNOTATION_NAME);
-		this.removeTypeDef_(index);
+		this.javaResourceannotatedElement.removeAnnotation(index, TypeDefAnnotation.ANNOTATION_NAME);
+		this.typeDefContainer.removeContextElement(index);
 	}
 
-	protected void removeTypeDef_(int index) {
-		this.removeItemFromList(index, this.typeDefs, TYPE_DEFS_LIST);
-	}
-
 	public void moveTypeDef(int targetIndex, int sourceIndex) {
-		this.getResourceAnnotatedElement().moveAnnotation(targetIndex, sourceIndex, TypeDefsAnnotation.ANNOTATION_NAME);
-		this.moveItemInList(targetIndex, sourceIndex, this.typeDefs, TYPE_DEFS_LIST);
+		this.javaResourceannotatedElement.moveAnnotation(targetIndex, sourceIndex, TypeDefAnnotation.ANNOTATION_NAME);
+		this.typeDefContainer.moveContextElement(targetIndex, sourceIndex);
 	}
 
-	protected void initializeTypeDefs() {
-		for (TypeDefAnnotation annotation : this.getTypeDefAnnotations()) {
-			this.typeDefs.add(this.buildTypeDef(annotation));
-		}
+	protected JavaTypeDef buildTypeDef(TypeDefAnnotation namedQueryAnnotation) {
+		return this.getJpaFactory().buildJavaTypeDef(this, namedQueryAnnotation);
 	}
 
-	protected JavaTypeDef buildTypeDef(TypeDefAnnotation typeDefAnnotation) {
-		return this.getJpaFactory().buildJavaTypeDef(this, typeDefAnnotation);
-	}
-
 	protected void syncTypeDefs() {
-		ContextContainerTools.synchronizeWithResourceModel(this.typeDefContainerAdapter);
+		this.typeDefContainer.synchronizeWithResourceModel();
 	}
 
-	protected Iterable<TypeDefAnnotation> getTypeDefAnnotations() {
-		return CollectionTools.iterable(this.typeDefAnnotations());
+	protected ListIterable<TypeDefAnnotation> getTypeDefAnnotations() {
+		return new SubListIterableWrapper<NestableAnnotation, TypeDefAnnotation>(this.getNestableTypeDefAnnotations_());
 	}
 
-	protected Iterator<TypeDefAnnotation> typeDefAnnotations() {
-		return new SuperIteratorWrapper<TypeDefAnnotation>(this.nestableTypeDefAnnotations());
+	protected ListIterable<NestableAnnotation> getNestableTypeDefAnnotations_() {
+		return this.javaResourceannotatedElement.getAnnotations(TypeDefAnnotation.ANNOTATION_NAME);
 	}
 
-	protected Iterator<TypeDefAnnotation> nestableTypeDefAnnotations() {
-		return new SubIteratorWrapper<NestableAnnotation, TypeDefAnnotation>(this.nestableTypeDefAnnotations_());
+	protected ContextListContainer<JavaTypeDef, TypeDefAnnotation> buildTypeDefContainer() {
+		TypeDefContainer container = new TypeDefContainer();
+		container.initialize();
+		return container;
 	}
 
-	protected Iterator<NestableAnnotation> nestableTypeDefAnnotations_() {
-		return this.getResourceAnnotatedElement().annotations(TypeDefAnnotation.ANNOTATION_NAME, TypeDefsAnnotation.ANNOTATION_NAME);
+	/**
+	 * named query container
+	 */
+	protected class TypeDefContainer
+		extends ContextListContainer<JavaTypeDef, TypeDefAnnotation>
+	{
+		@Override
+		protected String getContextElementsPropertyName() {
+			return TYPE_DEFS_LIST;
+		}
+		@Override
+		protected JavaTypeDef buildContextElement(TypeDefAnnotation resourceElement) {
+			return HibernateJavaTypeDefContainerImpl.this.buildTypeDef(resourceElement);
+		}
+		@Override
+		protected ListIterable<TypeDefAnnotation> getResourceElements() {
+			return HibernateJavaTypeDefContainerImpl.this.getTypeDefAnnotations();
+		}
+		@Override
+		protected TypeDefAnnotation getResourceElement(JavaTypeDef contextElement) {
+			return contextElement.getTypeDefAnnotation();
+		}
 	}
 
-	protected void moveTypeDef_(int index, JavaTypeDef typeDef) {
-		this.moveItemInList(index, typeDef, this.typeDefs, TYPE_DEFS_LIST);
-	}
-
-	protected JavaTypeDef addTypeDef_(int index, TypeDefAnnotation typeDefAnnotation) {
-		JavaTypeDef typeDef = this.buildTypeDef(typeDefAnnotation);
-		this.addItemToList(index, typeDef, this.typeDefs, TYPE_DEFS_LIST);
-		return typeDef;
-	}
-
-	protected void removeTypeDef_(JavaTypeDef typeDef) {
-		this.removeTypeDef_(this.typeDefs.indexOf(typeDef));
-	}
-	
 	// ********** validation **********
 
 	@Override
 	public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
 		super.validate(messages, reporter, astRoot);
-		for (JavaTypeDef typeDef : typeDefs) {
+		for (JavaTypeDef typeDef : getTypeDefs()) {
 			typeDef.validate(messages, reporter, astRoot);
 		}
 	}
 	
 	public TextRange getValidationTextRange(CompilationUnit astRoot) {
-		return this.javaResourcePersistentElement.getTextRange(astRoot);
+		return this.javaResourceannotatedElement.getTextRange(astRoot);
 	}
-	
-	protected class TypeDefContainerAdapter
-		implements ContextContainerTools.Adapter<JavaTypeDef, TypeDefAnnotation>
-	{
-		public Iterable<JavaTypeDef> getContextElements() {
-			return HibernateJavaTypeDefContainerImpl.this.getTypeDefs();
-		}
-		public Iterable<TypeDefAnnotation> getResourceElements() {
-			return HibernateJavaTypeDefContainerImpl.this.getTypeDefAnnotations();
-		}
-		public TypeDefAnnotation getResourceElement(JavaTypeDef contextElement) {
-			return contextElement.getTypeDefAnnotation();
-		}
-		public void moveContextElement(int index, JavaTypeDef element) {
-			HibernateJavaTypeDefContainerImpl.this.moveTypeDef_(index, element);
-		}
-		public void addContextElement(int index, TypeDefAnnotation resourceElement) {
-			HibernateJavaTypeDefContainerImpl.this.addTypeDef_(index, resourceElement);
-		}
-		public void removeContextElement(JavaTypeDef element) {
-			HibernateJavaTypeDefContainerImpl.this.removeTypeDef_(element);
-		}
+
 }
-}

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateNamedNativeQueryImpl.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateNamedNativeQueryImpl.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateNamedNativeQueryImpl.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2009-2011 Red Hat, Inc.
+ * Copyright (c) 2009-2012 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,
@@ -12,8 +12,8 @@
 
 import java.util.List;
 
-import org.eclipse.jdt.core.dom.CompilationUnit;
 import org.eclipse.jpt.jpa.core.context.java.JavaJpaContextNode;
+import org.eclipse.jpt.jpa.core.jpql.JpaJpqlQueryHelper;
 import org.eclipse.wst.validation.internal.provisional.core.IMessage;
 import org.eclipse.wst.validation.internal.provisional.core.IReporter;
 import org.jboss.tools.hibernate.jpt.core.internal.context.HibernateNamedNativeQuery;
@@ -27,6 +27,7 @@
 	implements HibernateJavaNamedNativeQuery {
 
 	protected String resultClass;
+	protected String fullyQualifiedResultClass;
 
 	protected String resultSetMapping;
 
@@ -50,12 +51,23 @@
 		this.setSpecifiedReadOnly_(this.queryAnnotation.isCallable());
 	}
 
+	@Override
+	public void update() {
+		super.update();
+		this.setFullyQualifiedResultClass(this.buildFullyQualifiedResultClass());
+	}
+	// ********** metadata conversion *********
+	@Override
+	public void delete() {
+		this.getParent().removeHibernateNamedNativeQuery(this);
+	}
+
 	// ********** result class **********
-
+	@Override
 	public String getResultClass() {
 		return this.resultClass;
 	}
-
+	@Override
 	public void setResultClass(String resultClass) {
 		this.queryAnnotation.setResultClass(resultClass);
 		this.setResultClass_(resultClass);
@@ -66,18 +78,31 @@
 		this.resultClass = resultClass;
 		this.firePropertyChanged(RESULT_CLASS_PROPERTY, old, resultClass);
 	}
-
+	@Override
 	public char getResultClassEnclosingTypeSeparator() {
 		return '.';
 	}
+	@Override
+	public String getFullyQualifiedResultClass() {
+		return this.fullyQualifiedResultClass;
+	}
+	
+	protected void setFullyQualifiedResultClass(String resultClass) {
+		String old = this.fullyQualifiedResultClass;
+		this.fullyQualifiedResultClass = resultClass;
+		this.firePropertyChanged(FULLY_QUALIFIED_RESULT_CLASS_PROPERTY, old, resultClass);
+	}
 
+	protected String buildFullyQualifiedResultClass() {
+		return this.queryAnnotation.getFullyQualifiedResultClassName();
+	}
 
 	// ********** result set mapping **********
-
+	@Override
 	public String getResultSetMapping() {
 		return this.resultSetMapping;
 	}
-
+	@Override
 	public void setResultSetMapping(String resultSetMapping) {
 		this.queryAnnotation.setResultSetMapping(resultSetMapping);
 		this.setResultSetMapping_(resultSetMapping);
@@ -90,15 +115,16 @@
 	}
 
 	//************************ callable *********************************
+	@Override
 	public boolean isCallable(){
 		return (getSpecifiedCallable() == null ? isDefaultCallable()
 				: getSpecifiedCallable().booleanValue());
 	}
-
+	@Override
 	public Boolean getSpecifiedCallable(){
 		return this.specifiedCallable;
 	}
-
+	@Override
 	public void setSpecifiedCallable(Boolean newSpecifiedCallable){
 		Boolean oldSpecifiedCallable = this.specifiedCallable;
 		this.specifiedCallable = newSpecifiedCallable;
@@ -106,12 +132,13 @@
 		firePropertyChanged(SPECIFIED_CALLABLE_PROPERTY, oldSpecifiedCallable, newSpecifiedCallable);
 	}
 
-	public void setSpecifiedCallable_(Boolean callable){
+	protected void setSpecifiedCallable_(Boolean callable){
 		Boolean oldSpecifiedCallable = this.specifiedCallable;
 		this.specifiedCallable = callable;
 		firePropertyChanged(SPECIFIED_CALLABLE_PROPERTY, oldSpecifiedCallable, callable);
 	}
 
+	@Override
 	public boolean isDefaultCallable(){
 		return HibernateNamedNativeQuery.DEFAULT_CALLABLE;
 	}
@@ -119,8 +146,14 @@
 	// ********** validation **********
 
 	@Override
-	protected void validateQuery_(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
+	protected void validateQuery_(JpaJpqlQueryHelper queryHelper, List<IMessage> messages, IReporter reporter) {
 		// nothing yet
 	}
+	
+	// ********** misc **********
+	@Override
+	public Class<HibernateNamedNativeQuery> getType() {
+		return HibernateNamedNativeQuery.class;
+	}
 
 }

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateNamedQueryImpl.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateNamedQueryImpl.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateNamedQueryImpl.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2009-2011 Red Hat, Inc.
+ * Copyright (c) 2009-2012 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,
@@ -12,11 +12,11 @@
 
 import java.util.List;
 
-import org.eclipse.jdt.core.dom.CompilationUnit;
 import org.eclipse.jpt.jpa.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.jpa.core.internal.jpql.JpaJpqlQueryHelper;
+import org.eclipse.jpt.jpa.core.jpql.JpaJpqlQueryHelper;
 import org.eclipse.wst.validation.internal.provisional.core.IMessage;
 import org.eclipse.wst.validation.internal.provisional.core.IReporter;
+import org.jboss.tools.hibernate.jpt.core.internal.context.HibernateNamedQuery;
 import org.jboss.tools.hibernate.jpt.core.internal.resource.java.HibernateNamedQueryAnnotation;
 
 /**
@@ -30,12 +30,22 @@
 		super(parent, queryAnnotation);
 	}
 	
+	// ********** metadata conversion *********
+	@Override
+	public void delete() {
+		this.getParent().removeHibernateNamedQuery(this);
+	}
+	
 	// ********** validation **********
 
 	@Override
-	protected void validateQuery_(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
-		JpaJpqlQueryHelper helper = new JpaJpqlQueryHelper();
-		helper.validate(this, this.query, this.getQueryAnnotation().getQueryTextRange(astRoot), 1, messages);
+	protected void validateQuery_(JpaJpqlQueryHelper queryHelper, List<IMessage> messages, IReporter reporter) {
+		queryHelper.validate(this, this.query, this.queryAnnotation.getQueryTextRange(), 1, messages);
 	}
 
+	// ********** misc **********
+	@Override
+	public Class<HibernateNamedQuery> getType() {
+		return HibernateNamedQuery.class;
+	}
 }

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernatePackageInfo.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernatePackageInfo.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernatePackageInfo.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -17,7 +17,7 @@
  * @author Dmitry Geraskov
  *
  */
-public interface HibernatePackageInfo extends JavaPackageInfo, JavaGeneratorContainer.Owner, JavaQueryContainer.Owner{
+public interface HibernatePackageInfo extends JavaPackageInfo, JavaGeneratorContainer.ParentAdapter, JavaQueryContainer.Owner{
 	
 	JavaQueryContainer getQueryContainer();
 	JavaGeneratorContainer getGeneratorContainer();

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernatePackageInfoImpl.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernatePackageInfoImpl.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernatePackageInfoImpl.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -18,18 +18,19 @@
 import org.eclipse.jdt.core.dom.CompilationUnit;
 import org.eclipse.jpt.common.core.JptCommonCorePlugin;
 import org.eclipse.jpt.common.core.JptResourceType;
+import org.eclipse.jpt.common.core.internal.resource.java.source.SourceNode;
+import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
+import org.eclipse.jpt.common.core.resource.java.JavaResourcePackage;
 import org.eclipse.jpt.common.core.utility.TextRange;
 import org.eclipse.jpt.common.utility.Filter;
 import org.eclipse.jpt.jpa.core.JpaFile;
 import org.eclipse.jpt.jpa.core.JpaStructureNode;
+import org.eclipse.jpt.jpa.core.JpaStructureNode.ContextType;
 import org.eclipse.jpt.jpa.core.context.PersistentType;
 import org.eclipse.jpt.jpa.core.context.java.JavaGeneratorContainer;
+import org.eclipse.jpt.jpa.core.context.java.JavaJpaContextNode;
 import org.eclipse.jpt.jpa.core.context.java.JavaQueryContainer;
-import org.eclipse.jpt.jpa.core.context.java.JavaStructureNodes;
 import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaJpaContextNode;
-import org.eclipse.jpt.jpa.core.internal.resource.java.source.SourceNode;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePackage;
 import org.eclipse.jst.j2ee.model.internal.validation.ValidationCancelledException;
 import org.eclipse.wst.validation.internal.provisional.core.IMessage;
 import org.eclipse.wst.validation.internal.provisional.core.IReporter;
@@ -108,7 +109,15 @@
 	public JptResourceType getResourceType() {
 		return JptCommonCorePlugin.JAVA_SOURCE_PACKAGE_INFO_RESOURCE_TYPE;
 	}
-
+	@Override
+	public boolean parentSupportsGenerators() {
+		return true;
+	}
+	
+	@Override
+	public ContextType getContextType() {
+		return new ContextType(this);
+	}
 	// ********** name **********
 
 	public String getName() {
@@ -144,7 +153,7 @@
 	}
 
 	protected JavaGeneratorContainer buildGeneratorContainer() {
-		return this.getJpaFactory().buildJavaGeneratorContainer(this, this);
+		return this.getJpaFactory().buildJavaGeneratorContainer(this);
 	}
 
 	// ********** query container **********
@@ -181,12 +190,6 @@
 		return (fullTextRange == null) ? false : fullTextRange.includes(offset);
 	}
 
-
-	public String getId() {
-		//FIXME check this is correct
-		return JavaStructureNodes.COMPILATION_UNIT_ID;
-	}
-
 	public void dispose() {
 		this.unregisterRootStructureNode();
 	}
@@ -210,9 +213,19 @@
 	}
 	
 	@Override
+	public JavaJpaContextNode getGeneratorContainerParent() {
+		return this;  // no adapter
+	}
+	
+	@Override
 	public JavaResourceAnnotatedElement getResourceAnnotatedElement() {
 		return this.resourcePackage;
 	}
+	
+	@Override
+	public Class<? extends JpaStructureNode> getType() {
+		return JavaPackageInfo.class;
+	}
 
 	/* (non-Javadoc)
 	 * @see org.jboss.tools.hibernate.jpt.core.internal.context.java.JavaPackageInfo#validate(java.util.List, org.eclipse.wst.validation.internal.provisional.core.IReporter)
@@ -249,21 +262,21 @@
 	}
 	
 	@Override
-	public Iterator<String> javaCompletionProposals(int pos,
+	public Iterable<String> getJavaCompletionProposals(int pos,
 			Filter<String> filter, CompilationUnit astRoot) {
-		Iterator<String> result = super.javaCompletionProposals(pos, filter, astRoot);
+		Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
 		if (result != null) {
 			return result;
 		}
-		result = this.typeDefContainer.javaCompletionProposals(pos, filter, astRoot);
+		result = this.typeDefContainer.getJavaCompletionProposals(pos, filter, astRoot);
 		if (result != null) {
 			return result;
 		}
-		result = this.generatorContainer.javaCompletionProposals(pos, filter, astRoot);
+		result = this.generatorContainer.getJavaCompletionProposals(pos, filter, astRoot);
 		if (result != null) {
 			return result;
 		}
-		result = this.queryContainer.javaCompletionProposals(pos, filter, astRoot);
+		result = this.queryContainer.getJavaCompletionProposals(pos, filter, astRoot);
 		if (result != null) {
 			return result;
 		}

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/JavaGenericGeneratorImpl.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/JavaGenericGeneratorImpl.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/JavaGenericGeneratorImpl.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -11,7 +11,6 @@
 package org.jboss.tools.hibernate.jpt.core.internal.context.java;
 
 import java.util.ArrayList;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Vector;
 
@@ -20,12 +19,11 @@
 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.CollectionTools;
 import org.eclipse.jpt.common.utility.internal.StringTools;
 import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable;
 import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
 import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneListIterable;
-import org.eclipse.jpt.jpa.core.context.java.JavaJpaContextNode;
+import org.eclipse.jpt.jpa.core.context.orm.EntityMappings;
 import org.eclipse.jpt.jpa.core.internal.context.ContextContainerTools;
 import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaGenerator;
 import org.eclipse.wst.validation.internal.provisional.core.IMessage;
@@ -73,7 +71,7 @@
 	/**
 	 * @param parent
 	 */
-	public JavaGenericGeneratorImpl(JavaJpaContextNode parent, GenericGeneratorAnnotation generatorAnnotation) {
+	public JavaGenericGeneratorImpl(HibernateJavaGeneratorContainer parent, GenericGeneratorAnnotation generatorAnnotation) {
 		super(parent, generatorAnnotation);
 		this.strategy = generatorAnnotation.getStrategy();
 		this.initializeParameters();
@@ -91,7 +89,27 @@
 		super.update();
 		this.updateNodes(this.getParameters());
 	}
+	
+	// ********** metadata conversion **********
+	@Override
+	public HibernateJavaGeneratorContainer getParent() {
+		return (HibernateJavaGeneratorContainer) super.getParent();
+	}
+	
+	public void convertTo(EntityMappings entityMappings) {
+		//what is this?
+	}
 
+	public void delete() {
+		this.getParent().removeGenericGenerator(this);
+	}
+	
+	// ********** misc **********
+
+	public Class<GenericGenerator> getType() {
+		return GenericGenerator.class;
+	}
+
 	// ********** strategy **********
 	public String getStrategy() {
 		return this.strategy;
@@ -211,8 +229,8 @@
 	}
 
 	protected void initializeParameters() {
-		for (Iterator<ParameterAnnotation> stream = this.generatorAnnotation.parameters(); stream.hasNext(); ) {
-			this.parameters.add(this.buildParameter(stream.next()));
+		for (ParameterAnnotation param : this.generatorAnnotation.getParameters()) {
+			this.parameters.add(this.buildParameter(param));
 		}
 	}
 
@@ -225,7 +243,7 @@
 	}
 
 	protected Iterable<ParameterAnnotation> getParameterAnnotations() {
-		return CollectionTools.iterable(this.generatorAnnotation.parameters());
+		return this.generatorAnnotation.getParameters();
 	}
 
 	protected void moveParameter_(int index, JavaParameter parameter) {
@@ -277,14 +295,14 @@
 	 * @see org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaJpaContextNode#javaCompletionProposals(int, org.eclipse.jpt.common.utility.Filter, org.eclipse.jdt.core.dom.CompilationUnit)
 	 */
 	@Override
-	public Iterator<String> javaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
-		Iterator<String> result = super.javaCompletionProposals(pos, filter, astRoot);
+	public Iterable<String> getJavaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
+		Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
 		if (result != null) {
 			return result;
 		}
 		TextRange strategyRange = getStrategyTextRange(astRoot);
 		if (strategyRange != null && strategyRange.touches(pos)) {
-			return getJavaCandidateNames(filter).iterator();
+			return getJavaCandidateNames(filter);
 		}
 		return null;
 	}

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/JavaPackageInfo.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/JavaPackageInfo.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/JavaPackageInfo.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -12,11 +12,11 @@
 
 import java.util.List;
 
+import org.eclipse.jpt.common.core.resource.java.JavaResourcePackage;
 import org.eclipse.jpt.common.core.utility.TextRange;
 import org.eclipse.jpt.jpa.core.JpaStructureNode;
 import org.eclipse.jpt.jpa.core.context.JpaContextNode;
 import org.eclipse.jpt.jpa.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePackage;
 import org.eclipse.wst.validation.internal.provisional.core.IMessage;
 import org.eclipse.wst.validation.internal.provisional.core.IReporter;
 

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/JavaTypeConverter.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/JavaTypeConverter.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/JavaTypeConverter.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -10,11 +10,11 @@
  ******************************************************************************/
 package org.jboss.tools.hibernate.jpt.core.internal.context.java;
 
+import org.eclipse.jpt.common.core.resource.java.Annotation;
 import org.eclipse.jpt.jpa.core.JpaFactory;
 import org.eclipse.jpt.jpa.core.context.Converter;
 import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMapping;
 import org.eclipse.jpt.jpa.core.context.java.JavaConverter;
-import org.eclipse.jpt.jpa.core.resource.java.Annotation;
 import org.jboss.tools.hibernate.jpt.core.internal.HibernateAbstractJpaFactory;
 import org.jboss.tools.hibernate.jpt.core.internal.context.TypeConverter;
 import org.jboss.tools.hibernate.jpt.core.internal.resource.java.TypeAnnotation;
@@ -49,7 +49,7 @@
 		}
 
 		public JavaConverter buildConverter(Annotation converterAnnotation, JavaAttributeMapping parent, JpaFactory factory) {
-			return ((HibernateAbstractJpaFactory)factory).buildJavaTypeConverter(parent, (TypeAnnotation) converterAnnotation);
+			return ((HibernateAbstractJpaFactory)factory).buildJavaTypeConverter(parent, (TypeAnnotation) converterAnnotation, this.buildOwner());
 		}
 	}
 }

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/JavaTypeConverterImpl.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/JavaTypeConverterImpl.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/JavaTypeConverterImpl.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -11,9 +11,11 @@
 package org.jboss.tools.hibernate.jpt.core.internal.context.java;
 
 import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jpt.common.core.resource.java.Annotation;
 import org.eclipse.jpt.common.core.utility.TextRange;
 import org.eclipse.jpt.jpa.core.context.Converter;
 import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMapping;
+import org.eclipse.jpt.jpa.core.context.java.JavaConverter;
 import org.eclipse.jpt.jpa.core.internal.jpa1.context.java.AbstractJavaConverter;
 import org.jboss.tools.hibernate.jpt.core.internal.context.TypeConverter;
 import org.jboss.tools.hibernate.jpt.core.internal.resource.java.TypeAnnotation;
@@ -29,8 +31,8 @@
 	
 	protected String type;
 
-	public JavaTypeConverterImpl(JavaAttributeMapping parent, TypeAnnotation typeAnnotation) {
-		super(parent);
+	public JavaTypeConverterImpl(JavaAttributeMapping parent, TypeAnnotation typeAnnotation, JavaConverter.Owner owner) {
+		super(parent, owner);
 		this.typeAnnotation = typeAnnotation;
 		type = buildHibernateType();
 	}
@@ -50,10 +52,10 @@
 	public Class<? extends Converter> getType() {
 		return TypeConverter.class;
 	}
-
+	
 	@Override
-	protected String getAnnotationName() {
-		return TypeAnnotation.ANNOTATION_NAME;
+	public Annotation getConverterAnnotation() {
+		return typeAnnotation;
 	}
 
 	// ********** type **********

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/JavaTypeDefImpl.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/JavaTypeDefImpl.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/JavaTypeDefImpl.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -194,8 +194,8 @@
 	}
 
 	protected void initializeParameters() {
-		for (Iterator<ParameterAnnotation> stream = this.typeDefAnnotation.parameters(); stream.hasNext(); ) {
-			this.parameters.add(this.buildParameter(stream.next()));
+		for (ParameterAnnotation param : this.typeDefAnnotation.getParameters()) {
+			this.parameters.add(this.buildParameter(param));
 		}
 	}
 
@@ -208,7 +208,7 @@
 	}
 
 	protected Iterable<ParameterAnnotation> getParameterAnnotations() {
-		return CollectionTools.iterable(this.typeDefAnnotation.parameters());
+		return this.typeDefAnnotation.getParameters();
 	}
 
 	protected void moveParameter_(int index, JavaParameter parameter) {
@@ -310,13 +310,9 @@
 					messages.add(HibernateJpaValidationMessage.buildMessage(
 							IMessage.HIGH_SEVERITY,TYPE_CLASS_NOT_FOUND, new String[]{typeClass}, this, this.getTypeClassTextRange(astRoot)));
 				} else {
-					Boolean isImplements = JpaUtil.isTypeImplementsOneOfInterfaces(getJpaProject().getJavaProject(), lwType,
-							 JavaTypeDef.POSSIBLE_INTERFACES);
-					if (isImplements == null){
+					if (!JpaUtil.isTypeImplementsOneOfInterfaces(getJpaProject().getJavaProject(), lwType,
+							 JavaTypeDef.POSSIBLE_INTERFACES)){
 						messages.add(HibernateJpaValidationMessage.buildMessage(
-								IMessage.HIGH_SEVERITY,INCONSISTENT_TYPE_HIERARCHY, new String[]{typeClass}, this, this.getTypeClassTextRange(astRoot)));
-					} else if (!isImplements){
-						messages.add(HibernateJpaValidationMessage.buildMessage(
 								IMessage.HIGH_SEVERITY,IMPLEMENT_USER_TYPE_INTERFACE, new String[]{typeClass}, this, this.getTypeClassTextRange(astRoot)));
 					 }
 				}
@@ -324,6 +320,25 @@
 				// just ignore it!
 			}
 		}
+		
+		
+		for (ListIterator<JavaTypeDef> stream = this.getPersistenceUnit().typeDefs(); stream.hasNext(); ) {
+			JavaTypeDef typeDef = stream.next();
+			if (this != typeDef){
+				if (this.name.equals(typeDef.getName())) {
+					messages.add(
+							HibernateJpaValidationMessage.buildMessage(
+									IMessage.HIGH_SEVERITY,
+									TYPE_DEF_DUPLICATE_NAME,
+									new String[]{this.name},
+									this,
+									this.getNameTextRange(astRoot))
+					);
+					break;
+				}
+			}
+		}
+		
 	}
 
 }

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/TypeImpl.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/TypeImpl.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/TypeImpl.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -11,7 +11,6 @@
 package org.jboss.tools.hibernate.jpt.core.internal.context.java;
 
 import java.util.Arrays;
-import java.util.Iterator;
 import java.util.List;
 
 import org.eclipse.jdt.core.IType;
@@ -25,6 +24,7 @@
 import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaJpaContextNode;
 import org.eclipse.wst.validation.internal.provisional.core.IMessage;
 import org.eclipse.wst.validation.internal.provisional.core.IReporter;
+import org.hibernate.type.TypeFactory;
 import org.jboss.tools.hibernate.jpt.core.internal.context.HibernatePersistenceUnit;
 import org.jboss.tools.hibernate.jpt.core.internal.context.Messages;
 import org.jboss.tools.hibernate.jpt.core.internal.resource.java.TypeAnnotation;
@@ -98,20 +98,20 @@
 	 * 
 	 * @see
 	 * org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaJpaContextNode
-	 * #javaCompletionProposals(int, org.eclipse.jpt.common.utility.Filter,
+	 * #getJavaCompletionProposals(int, org.eclipse.jpt.common.utility.Filter,
 	 * org.eclipse.jdt.core.dom.CompilationUnit)
 	 */
 	@Override
-	public Iterator<String> javaCompletionProposals(int pos,
+	public Iterable<String> getJavaCompletionProposals(int pos,
 			Filter<String> filter, CompilationUnit astRoot) {
-		Iterator<String> result = super.javaCompletionProposals(pos, filter,
+		Iterable<String> result = super.getJavaCompletionProposals(pos, filter,
 				astRoot);
 		if (result != null) {
 			return result;
 		}
 		TextRange typeRange = getTypeTextRange(astRoot);
 		if (typeRange != null && typeRange.touches(pos)) {
-			return getJavaCandidateNames(filter).iterator();
+			return getJavaCandidateNames(filter);
 		}
 		return null;
 	}
@@ -140,7 +140,7 @@
 				messages.add(HibernateJpaValidationMessage.buildMessage(
 						IMessage.HIGH_SEVERITY,
 						TYPE_CANT_BE_EMPTY, this, range));
-			} else if (!getPersistenceUnit().hasTypeDef(type))	{
+			} else if (TypeFactory.basic(type) == null && !getPersistenceUnit().hasTypeDef(type))	{
 				IType lwType = null;
 				try {
 					lwType = getJpaProject().getJavaProject().findType(type);

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/jpa2/HibernateJavaElementCollectionMapping2_0.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/jpa2/HibernateJavaElementCollectionMapping2_0.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/jpa2/HibernateJavaElementCollectionMapping2_0.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -13,8 +13,8 @@
 import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
 import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
 import org.eclipse.jpt.jpa.core.context.java.JavaConverter;
+import org.eclipse.jpt.jpa.core.context.java.JavaConverter.Adapter;
 import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaConverter.Adapter;
 import org.eclipse.jpt.jpa.core.internal.jpa2.context.java.AbstractJavaElementCollectionMapping2_0;
 import org.jboss.tools.hibernate.jpt.core.internal.context.java.JavaTypeConverter;
 

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/orm/HibernateOrmBasicMapping.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/orm/HibernateOrmBasicMapping.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/orm/HibernateOrmBasicMapping.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -11,10 +11,10 @@
 
 package org.jboss.tools.hibernate.jpt.core.internal.context.orm;
 
+import org.eclipse.jpt.jpa.core.context.ReadOnlyNamedColumn;
 import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
 import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmBasicMapping;
 import org.eclipse.jpt.jpa.core.resource.orm.XmlBasic;
-import org.eclipse.wst.validation.internal.core.Message;
 import org.eclipse.wst.validation.internal.provisional.core.IMessage;
 import org.hibernate.cfg.NamingStrategy;
 import org.jboss.tools.hibernate.jpt.core.internal.HibernateJpaProject;
@@ -39,7 +39,7 @@
 	}
 
 	@Override
-	public String getDefaultColumnName() {
+	public String getDefaultColumnName(ReadOnlyNamedColumn column) {
 		if (getName() != null){
 			NamingStrategy ns = getJpaProject().getNamingStrategy();
 			if (getJpaProject().isNamingStrategyEnabled() && ns != null) {
@@ -53,7 +53,7 @@
 				}
 			}
 		}
-		return super.getDefaultColumnName();
+		return super.getDefaultColumnName(column);
 	}
 
 }

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/orm/HibernateOrmEntityImpl.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/orm/HibernateOrmEntityImpl.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/orm/HibernateOrmEntityImpl.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -19,11 +19,9 @@
 import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable;
 import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
 import org.eclipse.jpt.common.utility.internal.iterators.EmptyListIterator;
-import org.eclipse.jpt.jpa.core.context.BaseJoinColumn;
 import org.eclipse.jpt.jpa.core.context.Entity;
-import org.eclipse.jpt.jpa.core.context.NamedColumn;
+import org.eclipse.jpt.jpa.core.context.ReadOnlyNamedColumn;
 import org.eclipse.jpt.jpa.core.context.ReadOnlyTable;
-import org.eclipse.jpt.jpa.core.context.TypeMapping;
 import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
 import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmEntity;
 import org.eclipse.jpt.jpa.core.internal.jpa2.context.orm.NullOrmCacheable2_0;
@@ -160,10 +158,6 @@
 //do we need this?
 	class HibernatePrimaryKeyJoinColumnOwner extends PrimaryKeyJoinColumnOwner
 	{
-		@Override
-		public TypeMapping getTypeMapping() {
-			return HibernateOrmEntityImpl.this;
-		}
 
 		public org.eclipse.jpt.jpa.db.Table getDbTable(String tableName) {
 			return HibernateOrmEntityImpl.this.resolveDbTable(tableName);
@@ -176,13 +170,13 @@
 		}
 
 		@Override
-		public int joinColumnsSize() {
-			return HibernateOrmEntityImpl.this.primaryKeyJoinColumnsSize();
+		public int getJoinColumnsSize() {
+			return HibernateOrmEntityImpl.this.getPrimaryKeyJoinColumnsSize();
 		}
 
 		@Override
-		public String getDefaultColumnName() {
-			if (joinColumnsSize() != 1) {
+		public String getDefaultColumnName(ReadOnlyNamedColumn column) {
+			if (getJoinColumnsSize() != 1) {
 				return null;
 			}
 			Entity parentEntity = HibernateOrmEntityImpl.this.getParentEntity();
@@ -198,7 +192,7 @@
 					} catch (Exception e) {
 						IMessage m = HibernateJpaValidationMessage.buildMessage(
 								IMessage.HIGH_SEVERITY,
-								Messages.NAMING_STRATEGY_EXCEPTION, this);
+								Messages.NAMING_STRATEGY_EXCEPTION, column);
 						HibernateJptPlugin.logException(m.getText(), e);
 					}
 				}
@@ -217,21 +211,6 @@
 			return null;
 		}
 
-		public IMessage buildUnresolvedNameMessage(NamedColumn column, TextRange textRange) {
-			throw new UnsupportedOperationException("validation not supported yet: bug 148262"); //$NON-NLS-1$
-		}
-
-		public IMessage buildUnresolvedReferencedColumnNameMessage(BaseJoinColumn column, TextRange textRange) {
-			throw new UnsupportedOperationException("validation not supported yet: bug 148262"); //$NON-NLS-1$
-		}
-
-		public IMessage buildUnspecifiedNameMultipleJoinColumnsMessage(BaseJoinColumn column, TextRange textRange) {
-			throw new UnsupportedOperationException("validation not supported yet: bug 148262"); //$NON-NLS-1$
-		}
-
-		public IMessage buildUnspecifiedReferencedColumnNameMultipleJoinColumnsMessage(BaseJoinColumn column, TextRange textRange) {
-			throw new UnsupportedOperationException("validation not supported yet: bug 148262"); //$NON-NLS-1$
-		}
 	}
 
 	@Override

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/orm/HibernateOrmIdMappingImpl.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/orm/HibernateOrmIdMappingImpl.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/orm/HibernateOrmIdMappingImpl.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -13,6 +13,7 @@
 
 import java.util.List;
 
+import org.eclipse.jpt.jpa.core.context.ReadOnlyNamedColumn;
 import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
 import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmIdMapping;
 import org.eclipse.jpt.jpa.core.internal.validation.DefaultJpaValidationMessages;
@@ -43,7 +44,7 @@
 	}
 
 	@Override
-	public String getDefaultColumnName() {
+	public String getDefaultColumnName(ReadOnlyNamedColumn column) {
 		if (getName() != null){
 			NamingStrategy namingStrategy = getJpaProject().getNamingStrategy();
 			if (getJpaProject().isNamingStrategyEnabled() && namingStrategy != null){
@@ -57,7 +58,7 @@
 				}
 			}
 		}
-		return super.getDefaultColumnName();
+		return super.getDefaultColumnName(column);
 	}
 	
 	@Override

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/orm/HibernateOrmJoinColumnImpl.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/orm/HibernateOrmJoinColumnImpl.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/orm/HibernateOrmJoinColumnImpl.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -11,12 +11,10 @@
 
 package org.jboss.tools.hibernate.jpt.core.internal.context.orm;
 
-import java.util.Iterator;
-
 import org.eclipse.jpt.jpa.core.context.Entity;
 import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
 import org.eclipse.jpt.jpa.core.context.XmlContextNode;
-import org.eclipse.jpt.jpa.core.context.orm.OrmJoinColumn;
+import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyJoinColumn;
 import org.eclipse.jpt.jpa.core.internal.jpa1.context.orm.GenericOrmJoinColumn;
 import org.eclipse.jpt.jpa.core.resource.orm.XmlJoinColumn;
 import org.eclipse.jpt.jpa.db.Column;
@@ -36,7 +34,7 @@
 public class HibernateOrmJoinColumnImpl extends GenericOrmJoinColumn implements
 		HibernateOrmJoinColumn {
 
-	public HibernateOrmJoinColumnImpl(XmlContextNode parent, OrmJoinColumn.Owner owner,
+	public HibernateOrmJoinColumnImpl(XmlContextNode parent, OrmReadOnlyJoinColumn.Owner owner,
 			XmlJoinColumn resourceJoinColumn) {
 		super(parent, owner, resourceJoinColumn);
 	}
@@ -121,7 +119,7 @@
 	}
 
 	public ReadOnlyPersistentAttribute getReferencedPersistentAttribute() {
-		if (this.owner.joinColumnsSize() != 1) {
+		if (this.owner.getJoinColumnsSize() != 1) {
 			return null;
 		}
 		Entity targetEntity = this.owner.getRelationshipTarget();
@@ -129,9 +127,7 @@
 			return null;
 		}
 		ReadOnlyPersistentAttribute pAttr = null;
-		Iterator<ReadOnlyPersistentAttribute> attributes = targetEntity.getPersistentType().allAttributes();
-		for (Iterator<ReadOnlyPersistentAttribute> stream = attributes; stream.hasNext();) {
-			ReadOnlyPersistentAttribute attribute = stream.next();
+		for (ReadOnlyPersistentAttribute attribute : targetEntity.getPersistentType().getAllAttributes()) {
 			String name = attribute.getPrimaryKeyColumnName();
 			if (name != null) {
 				if (pAttr == null){

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/orm/HibernateOrmManyToManyRelationshipReference.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/orm/HibernateOrmManyToManyRelationshipReference.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/orm/HibernateOrmManyToManyRelationshipReference.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -10,9 +10,9 @@
  ******************************************************************************/
 package org.jboss.tools.hibernate.jpt.core.internal.context.orm;
 
-import org.eclipse.jpt.jpa.core.context.orm.OrmJoinTableRelationshipStrategy;
 import org.eclipse.jpt.jpa.core.context.orm.OrmManyToManyMapping;
 import org.eclipse.jpt.jpa.core.internal.context.orm.GenericOrmManyToManyRelationship;
+import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmMappingJoinTableRelationshipStrategy2_0;
 
 /**
  * @author Dmitry Geraskov
@@ -30,7 +30,7 @@
 	}
 
 	@Override
-	protected OrmJoinTableRelationshipStrategy buildJoinTableStrategy() {
+	protected OrmMappingJoinTableRelationshipStrategy2_0 buildJoinTableStrategy() {
 		return 	new HibernateOrmJoinTableJoiningStrategy(this);
 	}
 

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/orm/HibernateOrmManyToOneRelationshipReference.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/orm/HibernateOrmManyToOneRelationshipReference.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/orm/HibernateOrmManyToOneRelationshipReference.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -11,9 +11,9 @@
 
 package org.jboss.tools.hibernate.jpt.core.internal.context.orm;
 
-import org.eclipse.jpt.jpa.core.context.orm.OrmJoinColumnRelationshipStrategy;
 import org.eclipse.jpt.jpa.core.context.orm.OrmManyToOneMapping;
 import org.eclipse.jpt.jpa.core.internal.context.orm.GenericOrmManyToOneRelationship;
+import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmMappingJoinColumnRelationshipStrategy2_0;
 
 /**
  * @author Dmitry Geraskov
@@ -28,7 +28,7 @@
 	}
 
 	@Override
-	protected OrmJoinColumnRelationshipStrategy buildJoinColumnStrategy() {
+	protected OrmMappingJoinColumnRelationshipStrategy2_0 buildJoinColumnStrategy() {
 		return new HibernateOrmJoinColumnJoiningStrategy(this);
 	}
 

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/orm/HibernateOrmOneToManyRelationshipReference.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/orm/HibernateOrmOneToManyRelationshipReference.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/orm/HibernateOrmOneToManyRelationshipReference.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -10,9 +10,9 @@
  ******************************************************************************/
 package org.jboss.tools.hibernate.jpt.core.internal.context.orm;
 
-import org.eclipse.jpt.jpa.core.context.orm.OrmJoinTableRelationshipStrategy;
 import org.eclipse.jpt.jpa.core.context.orm.OrmOneToManyMapping;
 import org.eclipse.jpt.jpa.core.internal.context.orm.GenericOrmOneToManyRelationship;
+import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmMappingJoinTableRelationshipStrategy2_0;
 
 /**
  * @author Dmitry Geraskov
@@ -30,7 +30,7 @@
 	}
 
 	@Override
-	protected OrmJoinTableRelationshipStrategy buildJoinTableStrategy() {
+	protected OrmMappingJoinTableRelationshipStrategy2_0 buildJoinTableStrategy() {
 		return new HibernateOrmJoinTableJoiningStrategy(this);
 	}
 

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/orm/HibernateOrmOneToOneRelationshipReference.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/orm/HibernateOrmOneToOneRelationshipReference.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/orm/HibernateOrmOneToOneRelationshipReference.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -14,6 +14,7 @@
 import org.eclipse.jpt.jpa.core.context.orm.OrmJoinColumnRelationshipStrategy;
 import org.eclipse.jpt.jpa.core.context.orm.OrmOneToOneMapping;
 import org.eclipse.jpt.jpa.core.internal.context.orm.GenericOrmOneToOneRelationship;
+import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmMappingJoinColumnRelationshipStrategy2_0;
 
 /**
  * @author Dmitry Geraskov
@@ -27,7 +28,7 @@
 	}
 
 	@Override
-	protected OrmJoinColumnRelationshipStrategy buildJoinColumnStrategy(){
+	protected OrmMappingJoinColumnRelationshipStrategy2_0 buildJoinColumnStrategy(){
 		return new HibernateOrmJoinColumnJoiningStrategy(this);
 	}
 

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/orm/HibernateOrmXmlContextNodeFactory.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/orm/HibernateOrmXmlContextNodeFactory.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/orm/HibernateOrmXmlContextNodeFactory.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -26,6 +26,7 @@
 import org.eclipse.jpt.jpa.core.context.orm.OrmOneToOneMapping;
 import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
 import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
+import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyJoinColumn;
 import org.eclipse.jpt.jpa.core.context.orm.OrmTable;
 import org.eclipse.jpt.jpa.core.internal.context.orm.GenericOrmXmlContextNodeFactory;
 import org.eclipse.jpt.jpa.core.resource.orm.XmlBasic;
@@ -73,14 +74,13 @@
 	}
 
 	@Override
-	public OrmColumn buildOrmColumn(XmlContextNode parent,
-			org.eclipse.jpt.jpa.core.context.orm.OrmColumn.Owner owner) {
+	public OrmColumn buildOrmColumn(XmlContextNode parent, OrmColumn.Owner owner) {
 		return new HibernateOrmColumnImpl(parent, owner);
 	}
 
 	@Override
 	public OrmJoinColumn buildOrmJoinColumn(XmlContextNode parent,
-			org.eclipse.jpt.jpa.core.context.orm.OrmJoinColumn.Owner owner,
+			OrmReadOnlyJoinColumn.Owner owner,
 			XmlJoinColumn resourceJoinColumn) {
 		return new HibernateOrmJoinColumnImpl(parent, owner, resourceJoinColumn);
 	}

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/orm/jpa2/HibernateOrmXml2_0ContextNodeFactory.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/orm/jpa2/HibernateOrmXml2_0ContextNodeFactory.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/orm/jpa2/HibernateOrmXml2_0ContextNodeFactory.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -26,6 +26,7 @@
 import org.eclipse.jpt.jpa.core.context.orm.OrmOneToOneMapping;
 import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
 import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
+import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyJoinColumn;
 import org.eclipse.jpt.jpa.core.context.orm.OrmTable;
 import org.eclipse.jpt.jpa.core.internal.jpa2.context.orm.GenericOrmXml2_0ContextNodeFactory;
 import org.eclipse.jpt.jpa.core.resource.orm.XmlBasic;
@@ -90,7 +91,7 @@
 	}
 
 	@Override
-	public OrmJoinColumn buildOrmJoinColumn(XmlContextNode parent, OrmJoinColumn.Owner owner, XmlJoinColumn xmlJoinColumn) {
+	public OrmJoinColumn buildOrmJoinColumn(XmlContextNode parent, OrmReadOnlyJoinColumn.Owner owner, XmlJoinColumn xmlJoinColumn) {
 		return new HibernateOrmJoinColumnImpl(parent, owner, xmlJoinColumn);
 	}
 

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/persistence/HibernateClassRef.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/persistence/HibernateClassRef.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/persistence/HibernateClassRef.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -10,23 +10,24 @@
  ******************************************************************************/
 package org.jboss.tools.hibernate.jpt.core.internal.context.persistence;
 
-import java.util.Iterator;
 import java.util.List;
 
 import org.eclipse.jdt.core.IPackageFragment;
+import org.eclipse.jpt.common.core.resource.java.JavaResourcePackage;
 import org.eclipse.jpt.common.utility.internal.StringTools;
 import org.eclipse.jpt.jpa.core.context.persistence.MappingFileRef;
 import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
 import org.eclipse.jpt.jpa.core.internal.jpa1.context.persistence.GenericClassRef;
 import org.eclipse.jpt.jpa.core.internal.validation.DefaultJpaValidationMessages;
 import org.eclipse.jpt.jpa.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePackage;
 import org.eclipse.jpt.jpa.core.resource.persistence.XmlJavaClassRef;
 import org.eclipse.jst.j2ee.model.internal.validation.ValidationCancelledException;
 import org.eclipse.wst.validation.internal.provisional.core.IMessage;
 import org.eclipse.wst.validation.internal.provisional.core.IReporter;
 import org.jboss.tools.hibernate.jpt.core.internal.HibernateAbstractJpaFactory;
 import org.jboss.tools.hibernate.jpt.core.internal.HibernateJptPlugin;
+import org.jboss.tools.hibernate.jpt.core.internal.context.java.HibernatePackageInfo;
+import org.jboss.tools.hibernate.jpt.core.internal.context.java.HibernatePackageInfoImpl;
 import org.jboss.tools.hibernate.jpt.core.internal.context.java.JavaPackageInfo;
 
 
@@ -41,7 +42,7 @@
 	 * test.some.pack.package-info.java file it should be included in persistent unit.
 	 * This can be <code>null</code> if the name is invalid.
 	 */
-	protected JavaPackageInfo javaPackageInfo;
+	protected HibernatePackageInfo javaPackageInfo;
 
 	
 	/**
@@ -95,11 +96,11 @@
 	
 	// ********** java persistent type **********
 
-	public JavaPackageInfo getJavaPackageInfo() {
+	public HibernatePackageInfo getJavaPackageInfo() {
 		return this.javaPackageInfo;
 	}
 
-	protected void setJavaPackageInfo(JavaPackageInfo javaPackageInfo) {
+	protected void setJavaPackageInfo(HibernatePackageInfo javaPackageInfo) {
 		JavaPackageInfo old = this.javaPackageInfo;
 		this.javaPackageInfo = javaPackageInfo;
 		this.firePropertyChanged(JAVA_PACKAGE_INFO_PROPERTY, old, javaPackageInfo);
@@ -135,7 +136,7 @@
 		return (javaPackageInfoName == null) ? null : this.getJpaProject().getJavaResourcePackage(javaPackageInfoName);
 	}
 
-	protected JavaPackageInfo buildJavaPackageInfo(JavaResourcePackage jrpt) {
+	protected HibernatePackageInfo buildJavaPackageInfo(JavaResourcePackage jrpt) {
 		return this.getJpaFactory().buildJavaPackageInfo(this, jrpt);
 	}
 	
@@ -178,18 +179,17 @@
 			// i.e. the persistence.xml ref is the only ref - none of the mapping
 			// files reference the same class
 			boolean validateJavaPersistentType = true;
-			for (Iterator<MappingFileRef> stream = this.getPersistenceUnit().mappingFileRefsContaining(this.getJavaClassName()); stream.hasNext(); ) {
+			for (MappingFileRef mappingFileRef : this.getPersistenceUnit().getMappingFileRefsContaining(this.getJavaClassName())) {
 				validateJavaPersistentType = false;
-				MappingFileRef mappingFileRef = stream.next();
 				messages.add(
-					DefaultJpaValidationMessages.buildMessage(
-						IMessage.LOW_SEVERITY,
-						JpaValidationMessages.PERSISTENCE_UNIT_REDUNDANT_CLASS,
-						new String[] {this.getJavaClassName(), mappingFileRef.getFileName()},
-						this,
-						this.getValidationTextRange()
-					)
-				);
+						DefaultJpaValidationMessages.buildMessage(
+							IMessage.LOW_SEVERITY,
+							JpaValidationMessages.PERSISTENCE_UNIT_REDUNDANT_CLASS,
+							new String[] {this.getJavaClassName(), mappingFileRef.getFileName()},
+							this,
+							this.getValidationTextRange()
+						)
+					);
 			}
 
 			if (validateJavaPersistentType) {

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/jpa2/HibernateJpa2_0AnnotationDefinitionProvider.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/jpa2/HibernateJpa2_0AnnotationDefinitionProvider.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/jpa2/HibernateJpa2_0AnnotationDefinitionProvider.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -12,22 +12,31 @@
 
 import java.util.ArrayList;
 
+import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
+import org.eclipse.jpt.common.core.resource.java.NestableAnnotationDefinition;
+import org.eclipse.jpt.common.utility.internal.CollectionTools;
 import org.eclipse.jpt.jpa.core.JpaAnnotationDefinitionProvider;
 import org.eclipse.jpt.jpa.core.internal.AbstractJpaAnnotationDefinitionProvider;
-import org.eclipse.jpt.jpa.core.resource.java.AnnotationDefinition;
+import org.eclipse.jpt.jpa.core.internal.resource.java.AssociationOverrideAnnotationDefinition;
+import org.eclipse.jpt.jpa.core.internal.resource.java.AttributeOverrideAnnotationDefinition;
+import org.eclipse.jpt.jpa.core.internal.resource.java.JoinColumnAnnotationDefinition;
+import org.eclipse.jpt.jpa.core.internal.resource.java.NamedNativeQueryAnnotationDefinition;
+import org.eclipse.jpt.jpa.core.internal.resource.java.NamedQueryAnnotationDefinition;
+import org.eclipse.jpt.jpa.core.internal.resource.java.PrimaryKeyJoinColumnAnnotationDefinition;
+import org.eclipse.jpt.jpa.core.internal.resource.java.SecondaryTableAnnotationDefinition;
 import org.jboss.tools.hibernate.jpt.core.internal.resource.java.DiscriminatorFormulaAnnotationImpl.DiscriminatorFormulaAnnotationDefinition;
 import org.jboss.tools.hibernate.jpt.core.internal.resource.java.ForeignKeyAnnotationImpl.ForeignKeyAnnotationDefinition;
 import org.jboss.tools.hibernate.jpt.core.internal.resource.java.GeneratedAnnotationImpl.GeneratedAnnotationDefinition;
-import org.jboss.tools.hibernate.jpt.core.internal.resource.java.GenericGeneratorAnnotationImpl.GenericGeneratorAnnotationDefinition;
+import org.jboss.tools.hibernate.jpt.core.internal.resource.java.GenericGeneratorAnnotationDefinition;
+import org.jboss.tools.hibernate.jpt.core.internal.resource.java.GenericGeneratorsAnnotationDefinition;
 import org.jboss.tools.hibernate.jpt.core.internal.resource.java.HibernateNamedNativeQueriesAnnotationDefinition;
 import org.jboss.tools.hibernate.jpt.core.internal.resource.java.HibernateNamedNativeQueryAnnotationDefinition;
 import org.jboss.tools.hibernate.jpt.core.internal.resource.java.HibernateNamedQueriesAnnotationDefinition;
 import org.jboss.tools.hibernate.jpt.core.internal.resource.java.HibernateNamedQueryAnnotationDefinition;
 import org.jboss.tools.hibernate.jpt.core.internal.resource.java.IndexAnnotationImpl.IndexAnnotationDefinition;
-import org.jboss.tools.hibernate.jpt.core.internal.resource.java.SourceGenericGeneratorsAnnotation.GenericGeneratorsAnnotationDefinition;
 import org.jboss.tools.hibernate.jpt.core.internal.resource.java.TypeAnnotationImpl.TypeAnnotationDefinition;
-import org.jboss.tools.hibernate.jpt.core.internal.resource.java.TypeDefAnnotationImpl.TypeDefAnnotationDefinition;
-import org.jboss.tools.hibernate.jpt.core.internal.resource.java.TypeDefsAnnotationImpl.TypeDefsAnnotationDefinition;
+import org.jboss.tools.hibernate.jpt.core.internal.resource.java.TypeDefAnnotationDefinition;
+import org.jboss.tools.hibernate.jpt.core.internal.resource.java.TypeDefsAnnotationDefinition;
 
 /**
  * @author Dmitry Geraskov
@@ -53,46 +62,52 @@
 	}
 
 	@Override
-	protected void addTypeAnnotationDefinitionsTo(ArrayList<AnnotationDefinition> definitions) {
-		definitions.add(GenericGeneratorAnnotationDefinition.instance());
+	protected void addAnnotationDefinitionsTo(ArrayList<AnnotationDefinition> definitions) {
+		//definitions.add(GenericGeneratorAnnotationDefinition.instance());
 		definitions.add(GenericGeneratorsAnnotationDefinition.instance());
-		definitions.add(TypeDefAnnotationDefinition.instance());
+		//definitions.add(TypeDefAnnotationDefinition.instance());
 		definitions.add(TypeDefsAnnotationDefinition.instance());
-		definitions.add(HibernateNamedQueryAnnotationDefinition.instance());
+		//definitions.add(HibernateNamedQueryAnnotationDefinition.instance());
 		definitions.add(HibernateNamedQueriesAnnotationDefinition.instance());
-		definitions.add(HibernateNamedNativeQueryAnnotationDefinition.instance());
+		//definitions.add(HibernateNamedNativeQueryAnnotationDefinition.instance());
 		definitions.add(HibernateNamedNativeQueriesAnnotationDefinition.instance());
 		definitions.add(DiscriminatorFormulaAnnotationDefinition.instance());
 		definitions.add(ForeignKeyAnnotationDefinition.instance());
-	}
-
-	@Override
-	protected void addAttributeAnnotationDefinitionsTo(ArrayList<AnnotationDefinition> definitions) {
-		definitions.add(GenericGeneratorAnnotationDefinition.instance());
+	//addAttributeAnnotationDefinitionsTo(ArrayList<AnnotationDefinition> definitions) {
+		//definitions.add(GenericGeneratorAnnotationDefinition.instance());
 		definitions.add(GeneratedAnnotationDefinition.instance());
-		definitions.add(TypeDefAnnotationDefinition.instance());
+		//definitions.add(TypeDefAnnotationDefinition.instance());
 		definitions.add(TypeDefsAnnotationDefinition.instance());
 		definitions.add(IndexAnnotationDefinition.instance());
 		definitions.add(TypeAnnotationDefinition.instance());
-		definitions.add(ForeignKeyAnnotationDefinition.instance());
+		//definitions.add(ForeignKeyAnnotationDefinition.instance());
+	//addPackageAnnotationDefinitionsTo
+//		definitions.add(GenericGeneratorAnnotationDefinition.instance());
+//		definitions.add(GenericGeneratorsAnnotationDefinition.instance());
+//		definitions.add(HibernateNamedQueryAnnotationDefinition.instance());
+//		definitions.add(HibernateNamedQueriesAnnotationDefinition.instance());
+//		definitions.add(HibernateNamedNativeQueryAnnotationDefinition.instance());
+//		definitions.add(HibernateNamedNativeQueriesAnnotationDefinition.instance());
+//		definitions.add(TypeDefAnnotationDefinition.instance());
+//		definitions.add(TypeDefsAnnotationDefinition.instance());
 	}
-
+	
 	@Override
-	protected void addTypeMappingAnnotationDefinitionsTo(
-			ArrayList<AnnotationDefinition> definitions) {
-
-	}
-
-	@Override
-	protected void addPackageAnnotationDefinitionsTo(
-			ArrayList<AnnotationDefinition> definitions) {
+	protected void addNestableAnnotationDefinitionsTo(ArrayList<NestableAnnotationDefinition> definitions) {
+		CollectionTools.addAll(definitions, NESTABLE_ANNOTATION_DEFINITIONS);
 		definitions.add(GenericGeneratorAnnotationDefinition.instance());
-		definitions.add(GenericGeneratorsAnnotationDefinition.instance());
+		definitions.add(TypeDefAnnotationDefinition.instance());
 		definitions.add(HibernateNamedQueryAnnotationDefinition.instance());
-		definitions.add(HibernateNamedQueriesAnnotationDefinition.instance());
 		definitions.add(HibernateNamedNativeQueryAnnotationDefinition.instance());
-		definitions.add(HibernateNamedNativeQueriesAnnotationDefinition.instance());
-		definitions.add(TypeDefAnnotationDefinition.instance());
-		definitions.add(TypeDefsAnnotationDefinition.instance());
 	}
+
+	protected static final NestableAnnotationDefinition[] NESTABLE_ANNOTATION_DEFINITIONS = new NestableAnnotationDefinition[] {
+		AssociationOverrideAnnotationDefinition.instance(),
+		AttributeOverrideAnnotationDefinition.instance(),
+		JoinColumnAnnotationDefinition.instance(),
+		NamedQueryAnnotationDefinition.instance(),
+		NamedNativeQueryAnnotationDefinition.instance(),
+		PrimaryKeyJoinColumnAnnotationDefinition.instance(),
+		SecondaryTableAnnotationDefinition.instance(),
+	};
 }

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/jpa2/HibernateJpa2_0PlatformFactory.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/jpa2/HibernateJpa2_0PlatformFactory.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/jpa2/HibernateJpa2_0PlatformFactory.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -10,15 +10,17 @@
   ******************************************************************************/
 package org.jboss.tools.hibernate.jpt.core.internal.jpa2;
 
-import org.eclipse.jpt.jpa.core.JpaAnnotationProvider;
+import org.eclipse.jpt.common.core.JptResourceType;
 import org.eclipse.jpt.jpa.core.JpaFacet;
 import org.eclipse.jpt.jpa.core.JpaFactory;
 import org.eclipse.jpt.jpa.core.JpaPlatform;
 import org.eclipse.jpt.jpa.core.JpaPlatformFactory;
 import org.eclipse.jpt.jpa.core.JpaPlatformVariation;
-import org.eclipse.jpt.jpa.core.internal.GenericJpaAnnotationProvider;
+import org.eclipse.jpt.jpa.core.context.AccessType;
 import org.eclipse.jpt.jpa.core.internal.GenericJpaPlatformFactory.SimpleVersion;
+import org.eclipse.jpt.jpa.core.internal.JpaAnnotationProvider;
 import org.eclipse.jpt.jpa.core.internal.jpa2.Generic2_0JpaAnnotationDefinitionProvider;
+import org.eclipse.persistence.jpa.jpql.parser.JPQLGrammar2_0;
 import org.jboss.tools.hibernate.jpt.core.internal.HibernateJpaPlatform;
 
 /**
@@ -41,7 +43,8 @@
 			this.buildJpaFactory(), 
 			this.buildJpaAnnotationProvider(), 
 			HibernateJpa2_0PlatformProvider.instance(),
-			this.buildJpaPlatformVariation());
+			this.buildJpaPlatformVariation(),
+			JPQLGrammar2_0.instance());
 	}
 	
 	
@@ -55,7 +58,7 @@
 	}
 	
 	protected JpaAnnotationProvider buildJpaAnnotationProvider() {
-		return new GenericJpaAnnotationProvider(
+		return new JpaAnnotationProvider(
 			Generic2_0JpaAnnotationDefinitionProvider.instance(),
 			HibernateJpa2_0AnnotationDefinitionProvider.instance());
 	}
@@ -69,6 +72,11 @@
 			public boolean isJoinTableOverridable() {
 				return true;
 			}
+			@Override
+			public AccessType[] getSupportedAccessTypes(
+					JptResourceType resourceType) {
+				return GENERIC_SUPPORTED_ACCESS_TYPES;
+			}
 		};
 	}
 

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/jpa2/HibernateJpaFactory2_0.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/jpa2/HibernateJpaFactory2_0.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/jpa2/HibernateJpaFactory2_0.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -11,6 +11,7 @@
 package org.jboss.tools.hibernate.jpt.core.internal.jpa2;
 
 
+import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
 import org.eclipse.jpt.jpa.core.JpaDataSource;
 import org.eclipse.jpt.jpa.core.JpaProject;
 import org.eclipse.jpt.jpa.core.context.PersistentType;
@@ -19,15 +20,14 @@
 import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMapping;
 import org.eclipse.jpt.jpa.core.context.java.JavaColumn;
 import org.eclipse.jpt.jpa.core.context.java.JavaEmbeddable;
+import org.eclipse.jpt.jpa.core.context.java.JavaGeneratorContainer;
 import org.eclipse.jpt.jpa.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.jpa.core.context.java.JavaManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaNamedColumn;
 import org.eclipse.jpt.jpa.core.context.java.JavaNamedQuery;
-import org.eclipse.jpt.jpa.core.context.java.JavaOneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaOneToOneMapping;
 import org.eclipse.jpt.jpa.core.context.java.JavaOrderable;
 import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
 import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
+import org.eclipse.jpt.jpa.core.context.java.JavaQueryContainer;
+import org.eclipse.jpt.jpa.core.context.java.JavaReadOnlyNamedColumn;
 import org.eclipse.jpt.jpa.core.context.java.JavaSequenceGenerator;
 import org.eclipse.jpt.jpa.core.internal.jpa1.context.java.GenericJavaAssociationOverrideContainer;
 import org.eclipse.jpt.jpa.core.internal.jpa1.context.java.GenericJavaColumn;
@@ -41,13 +41,12 @@
 import org.eclipse.jpt.jpa.core.internal.jpa2.context.java.GenericJavaNamedQuery2_0;
 import org.eclipse.jpt.jpa.core.internal.jpa2.context.java.GenericJavaOrderColumn2_0;
 import org.eclipse.jpt.jpa.core.internal.jpa2.context.java.GenericJavaOrphanRemoval2_0;
-import org.eclipse.jpt.jpa.core.internal.jpa2.context.java.GenericJavaPersistentAttribute2_0;
 import org.eclipse.jpt.jpa.core.internal.jpa2.context.java.GenericJavaPersistentType2_0;
 import org.eclipse.jpt.jpa.core.internal.jpa2.context.java.GenericJavaSequenceGenerator2_0;
 import org.eclipse.jpt.jpa.core.jpa2.JpaFactory2_0;
 import org.eclipse.jpt.jpa.core.jpa2.JpaProject2_0;
 import org.eclipse.jpt.jpa.core.jpa2.context.MetamodelSourceType;
-import org.eclipse.jpt.jpa.core.jpa2.context.Orderable2_0;
+import org.eclipse.jpt.jpa.core.jpa2.context.Orderable2_0.Owner;
 import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaCacheable2_0;
 import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaCacheableHolder2_0;
 import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaCollectionTable2_0;
@@ -62,15 +61,10 @@
 import org.eclipse.jpt.jpa.core.jpa2.resource.java.NamedQuery2_0Annotation;
 import org.eclipse.jpt.jpa.core.jpa2.resource.java.SequenceGenerator2_0Annotation;
 import org.eclipse.jpt.jpa.core.resource.java.EmbeddableAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentType;
 import org.eclipse.jpt.jpa.core.resource.java.NamedQueryAnnotation;
 import org.eclipse.jpt.jpa.core.resource.java.SequenceGeneratorAnnotation;
 import org.eclipse.jpt.jpa.db.DatabaseIdentifierAdapter;
 import org.jboss.tools.hibernate.jpt.core.internal.HibernateAbstractJpaFactory;
-import org.jboss.tools.hibernate.jpt.core.internal.context.java.HibernateJavaManyToOneMapping;
-import org.jboss.tools.hibernate.jpt.core.internal.context.java.HibernateJavaOneToManyMapping;
-import org.jboss.tools.hibernate.jpt.core.internal.context.java.HibernateJavaOneToOneMapping;
 import org.jboss.tools.hibernate.jpt.core.internal.context.java.jpa2.HibernateJavaElementCollectionMapping2_0;
 
 
@@ -107,24 +101,19 @@
 
 
 	// ********** Java Context Model **********
-
 	@Override
-	public JavaPersistentType buildJavaPersistentType(PersistentType.Owner owner, JavaResourcePersistentType jrpt) {
-		return new GenericJavaPersistentType2_0(owner, jrpt);
+	public JavaPersistentType buildJavaPersistentType(PersistentType.Owner owner,
+			JavaResourceType jrt) {
+		return new GenericJavaPersistentType2_0(owner, jrt);
 	}
-
+	
 	@Override
-	public JavaPersistentAttribute buildJavaPersistentAttribute(PersistentType parent, JavaResourcePersistentAttribute jrpa) {
-		return new GenericJavaPersistentAttribute2_0(parent, jrpa);
-	}
-
-	@Override
 	public JavaEmbeddable buildJavaEmbeddable(JavaPersistentType parent, EmbeddableAnnotation embeddableAnnotation) {
 		return new GenericJavaEmbeddable2_0(parent, embeddableAnnotation);
 	}
 
 	@Override
-	public JavaSequenceGenerator buildJavaSequenceGenerator(JavaJpaContextNode parent, SequenceGeneratorAnnotation annotation) {
+	public JavaSequenceGenerator buildJavaSequenceGenerator(JavaGeneratorContainer parent, SequenceGeneratorAnnotation annotation) {
 		return new GenericJavaSequenceGenerator2_0(parent, (SequenceGenerator2_0Annotation) annotation);
 	}
 
@@ -146,7 +135,7 @@
 	}
 
 	@Override
-	public JavaNamedQuery buildJavaNamedQuery(JavaJpaContextNode parent, NamedQueryAnnotation annotation) {
+	public JavaNamedQuery buildJavaNamedQuery(JavaQueryContainer parent, NamedQueryAnnotation annotation) {
 		return new GenericJavaNamedQuery2_0(parent, (NamedQuery2_0Annotation) annotation);
 	}
 
@@ -154,7 +143,7 @@
 		return new GenericJavaCollectionTable2_0(parent, owner);
 	}
 
-	public JavaOrderColumn2_0 buildJavaOrderColumn(JavaOrderable2_0 parent, JavaNamedColumn.Owner owner) {
+	public JavaOrderColumn2_0 buildJavaOrderColumn(JavaOrderable2_0 parent, JavaReadOnlyNamedColumn.Owner owner) {
 		return new GenericJavaOrderColumn2_0(parent, owner);
 	}
 
@@ -162,7 +151,7 @@
 		return new GenericJavaColumn(parent, owner);
 	}
 
-	public JavaOrderable2_0 buildJavaOrderable(JavaAttributeMapping parent, Orderable2_0.Owner owner) {
+	public JavaOrderable2_0 buildJavaOrderable(JavaAttributeMapping parent, Owner owner) {
 		return new GenericJavaOrderable(parent, owner);
 	}
 

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/jpa2/context/definition/HibernateJavaManyToManyMappingDefinition2_0.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/jpa2/context/definition/HibernateJavaManyToManyMappingDefinition2_0.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/jpa2/context/definition/HibernateJavaManyToManyMappingDefinition2_0.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -14,15 +14,15 @@
 import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
 import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMappingDefinition;
 import org.eclipse.jpt.jpa.core.internal.context.java.JavaAttributeMappingDefinitionWrapper;
+import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
 import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapKeyClass2_0Annotation;
 import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapKeyColumn2_0Annotation;
 import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapKeyEnumerated2_0Annotation;
 import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapKeyJoinColumn2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapKeyJoinColumns2_0Annotation;
 import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapKeyTemporal2_0Annotation;
 import org.eclipse.jpt.jpa.core.jpa2.resource.java.OrderColumn2_0Annotation;
 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.jboss.tools.hibernate.jpt.core.internal.context.definition.HibernateJavaManyToManyMappingDefinition;
 
 /**
@@ -64,12 +64,12 @@
 
 	public static final String[] SUPPORTING_ANNOTATION_NAMES_ARRAY_2_0 = new String[] {
 		AttributeOverrideAnnotation.ANNOTATION_NAME,
-		AttributeOverridesAnnotation.ANNOTATION_NAME,
+		JPA.ATTRIBUTE_OVERRIDES,
 		MapKeyClass2_0Annotation.ANNOTATION_NAME,
 		MapKeyColumn2_0Annotation.ANNOTATION_NAME,
 		MapKeyEnumerated2_0Annotation.ANNOTATION_NAME,
 		MapKeyJoinColumn2_0Annotation.ANNOTATION_NAME,
-		MapKeyJoinColumns2_0Annotation.ANNOTATION_NAME,
+		JPA2_0.MAP_KEY_JOIN_COLUMNS,
 		MapKeyTemporal2_0Annotation.ANNOTATION_NAME,
 		OrderColumn2_0Annotation.ANNOTATION_NAME
 	};

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/DiscriminatorFormulaAnnotation.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/DiscriminatorFormulaAnnotation.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/DiscriminatorFormulaAnnotation.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -11,8 +11,8 @@
 package org.jboss.tools.hibernate.jpt.core.internal.resource.java;
 
 import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jpt.common.core.resource.java.Annotation;
 import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.java.Annotation;
 import org.jboss.tools.hibernate.jpt.core.internal.context.basic.Hibernate;
 
 /**

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/DiscriminatorFormulaAnnotationImpl.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/DiscriminatorFormulaAnnotationImpl.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/DiscriminatorFormulaAnnotationImpl.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -12,27 +12,27 @@
 
 import org.eclipse.jdt.core.IAnnotation;
 import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
 import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
 import org.eclipse.jpt.common.core.internal.utility.jdt.ShortCircuitAnnotationElementAdapter;
 import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
+import org.eclipse.jpt.common.core.resource.java.Annotation;
+import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
+import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
+import org.eclipse.jpt.common.core.resource.java.JavaResourceMember;
+import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
 import org.eclipse.jpt.common.core.utility.TextRange;
 import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
 import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
 import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
 import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
 import org.eclipse.jpt.common.core.utility.jdt.Type;
-import org.eclipse.jpt.jpa.core.internal.resource.java.source.SourceAnnotation;
-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.JavaResourceNode;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentMember;
 
 /**
  * @author Dmitry Geraskov
  *
  */
-public class DiscriminatorFormulaAnnotationImpl extends SourceAnnotation<Type> implements
+public class DiscriminatorFormulaAnnotationImpl extends SourceAnnotation implements
 DiscriminatorFormulaAnnotation {
 
 	public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
@@ -120,12 +120,12 @@
 			return DiscriminatorFormulaAnnotation.ANNOTATION_NAME;
 		}
 
-		public Annotation buildAnnotation(JavaResourcePersistentMember arg0,
+		public Annotation buildAnnotation(JavaResourceMember arg0,
 				IAnnotation arg1) {
 			throw new UnsupportedOperationException();
 		}
 
-		public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) {
+		public Annotation buildNullAnnotation(JavaResourceMember parent) {
 			throw new UnsupportedOperationException();
 		}
 

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/ForeignKeyAnnotationImpl.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/ForeignKeyAnnotationImpl.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/ForeignKeyAnnotationImpl.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -13,27 +13,27 @@
 
 import org.eclipse.jdt.core.IAnnotation;
 import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
 import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
 import org.eclipse.jpt.common.core.internal.utility.jdt.ShortCircuitAnnotationElementAdapter;
 import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
+import org.eclipse.jpt.common.core.resource.java.Annotation;
+import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
+import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
+import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
 import org.eclipse.jpt.common.core.utility.TextRange;
 import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
 import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
 import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
 import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
 import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.jpa.core.internal.resource.java.source.SourceAnnotation;
-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.JavaResourceNode;
 import org.jboss.tools.hibernate.jpt.core.internal.context.java.ForeignKeyAnnotation;
 
 /**
  * @author Dmitry Geraskov
  *
  */
-public class ForeignKeyAnnotationImpl extends SourceAnnotation<Member> implements
+public class ForeignKeyAnnotationImpl extends SourceAnnotation implements
 ForeignKeyAnnotation {
 
 	public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/GeneratedAnnotation.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/GeneratedAnnotation.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/GeneratedAnnotation.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -11,8 +11,8 @@
 package org.jboss.tools.hibernate.jpt.core.internal.resource.java;
 
 import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jpt.common.core.resource.java.Annotation;
 import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.java.Annotation;
 import org.jboss.tools.hibernate.jpt.core.internal.context.GenerationTime;
 import org.jboss.tools.hibernate.jpt.core.internal.context.basic.Hibernate;
 

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/GeneratedAnnotationImpl.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/GeneratedAnnotationImpl.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/GeneratedAnnotationImpl.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -12,20 +12,20 @@
 
 import org.eclipse.jdt.core.IAnnotation;
 import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
 import org.eclipse.jpt.common.core.internal.utility.jdt.EnumDeclarationAnnotationElementAdapter;
 import org.eclipse.jpt.common.core.internal.utility.jdt.ShortCircuitAnnotationElementAdapter;
 import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
+import org.eclipse.jpt.common.core.resource.java.Annotation;
+import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
+import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
+import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
 import org.eclipse.jpt.common.core.utility.TextRange;
 import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
 import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
 import org.eclipse.jpt.common.core.utility.jdt.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.internal.resource.java.source.SourceAnnotation;
-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.JavaResourceNode;
 import org.jboss.tools.hibernate.jpt.core.internal.context.GenerationTime;
 import org.jboss.tools.hibernate.jpt.core.internal.context.basic.Hibernate;
 

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/GenericGeneratorAnnotation.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/GenericGeneratorAnnotation.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/GenericGeneratorAnnotation.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -10,12 +10,11 @@
   ******************************************************************************/
 package org.jboss.tools.hibernate.jpt.core.internal.resource.java;
 
-import java.util.ListIterator;
-
 import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
 import org.eclipse.jpt.common.core.utility.TextRange;
+import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
 import org.eclipse.jpt.jpa.core.resource.java.GeneratorAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.NestableAnnotation;
 import org.jboss.tools.hibernate.jpt.core.internal.context.basic.Hibernate;
 
 /**
@@ -41,15 +40,21 @@
 	String STRATEGY_PROPERTY = "strategyProperty";	 //$NON-NLS-1$
 	
 	/**
+	 * Return the {@link TextRange} for the strategy element.  If the strategy element 
+	 * does not exist return the {@link TextRange} for the GenericGenerator annotation.
+	 */
+	TextRange getStrategyTextRange(CompilationUnit astRoot);
+	
+	/**
 	 * Return an empty iterator if the element does not exist in Java.
 	 */
-	ListIterator<ParameterAnnotation> parameters();
+	ListIterable<ParameterAnnotation> getParameters();
 		String PARAMETERS_LIST = "parameters"; //$NON-NLS-1$
 	
 	/**
 	 * Corresponds to the 'parameters' element of the *Generic Generator annotation.
 	 */
-	int parametersSize();
+	int getParametersSize();
 
 	/**
 	 * Corresponds to the 'parameters' element of the *Generic Generator annotation.
@@ -59,11 +64,6 @@
 	/**
 	 * Corresponds to the 'parameters' element of the *Generic Generator annotation.
 	 */
-	int indexOfParameter(ParameterAnnotation parameter);
-	
-	/**
-	 * Corresponds to the 'parameters' element of the *Generic Generator annotation.
-	 */
 	ParameterAnnotation addParameter(int index);
 	
 	/**
@@ -74,12 +74,5 @@
 	/**
 	 * Corresponds to the 'parameters' element of the *Generic Generator annotation.
 	 */
-	void removeParameter(int index);	
-
-	/**
-	 * Return the {@link TextRange} for the strategy element.  If the strategy element 
-	 * does not exist return the {@link TextRange} for the GenericGenerator annotation.
-	 */
-	TextRange getStrategyTextRange(CompilationUnit astRoot);
-
+	void removeParameter(int index);
 }

Added: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/GenericGeneratorAnnotationDefinition.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/GenericGeneratorAnnotationDefinition.java	                        (rev 0)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/GenericGeneratorAnnotationDefinition.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -0,0 +1,73 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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.jboss.tools.hibernate.jpt.core.internal.resource.java;
+
+import org.eclipse.jdt.core.IAnnotation;
+import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
+import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
+import org.eclipse.jpt.common.core.resource.java.NestableAnnotationDefinition;
+import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
+import org.jboss.tools.hibernate.jpt.core.internal.context.basic.Hibernate;
+
+/**
+ * 
+ * @author Dmitry Geraskov
+ *
+ */
+public class GenericGeneratorAnnotationDefinition implements NestableAnnotationDefinition
+{
+	// singleton
+	private static final NestableAnnotationDefinition INSTANCE = new GenericGeneratorAnnotationDefinition();
+
+	/**
+	 * Return the singleton.
+	 */
+	public static NestableAnnotationDefinition instance() {
+		return INSTANCE;
+	}
+
+	/**
+	 * Ensure non-instantiability.
+	 */
+	private GenericGeneratorAnnotationDefinition() {
+		super();
+	}
+
+	@Override
+	public NestableAnnotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement, int index) {
+		return GenericGeneratorAnnotationImpl.buildGenericGeneratorAnnotation(parent, annotatedElement, index);
+	}
+	
+	@Override
+	public NestableAnnotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation, int index) {
+		throw new UnsupportedOperationException();
+	}
+
+
+	@Override
+	public String getNestableAnnotationName() {
+		return Hibernate.GENERIC_GENERATOR;
+	}
+
+	@Override
+	public String getContainerAnnotationName() {
+		return Hibernate.GENERIC_GENERATORS;
+	}
+
+	@Override
+	public String getElementName() {
+		return Hibernate.GENERIC_GENERATORS__VALUE;
+	}
+
+	
+
+
+}
\ No newline at end of file

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/GenericGeneratorAnnotationImpl.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/GenericGeneratorAnnotationImpl.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/GenericGeneratorAnnotationImpl.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -10,20 +10,16 @@
  ******************************************************************************/
 package org.jboss.tools.hibernate.jpt.core.internal.resource.java;
 
-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.IAnnotation;
 import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
+import org.eclipse.jpt.common.core.internal.utility.jdt.CombinationIndexedDeclarationAnnotationAdapter;
 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.ShortCircuitAnnotationElementAdapter;
 import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
+import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
+import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
+import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
 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;
@@ -32,29 +28,19 @@
 import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
 import org.eclipse.jpt.common.core.utility.jdt.IndexedAnnotationAdapter;
 import org.eclipse.jpt.common.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterators.CloneListIterator;
-import org.eclipse.jpt.jpa.core.internal.resource.java.source.AnnotationContainerTools;
-import org.eclipse.jpt.jpa.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.AnnotationContainer;
-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.JavaResourceNode;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.jpa.core.resource.java.NestableAnnotation;
+import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
 import org.jboss.tools.hibernate.jpt.core.internal.context.basic.Hibernate;
 
 /**
  * @author Dmitry Geraskov
  *
  */
-public class GenericGeneratorAnnotationImpl extends SourceAnnotation<AnnotatedElement>
+public class GenericGeneratorAnnotationImpl extends SourceAnnotation
 implements GenericGeneratorAnnotation {
 
 	private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
+	private static final DeclarationAnnotationAdapter CONTAINER_DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(Hibernate.GENERIC_GENERATORS);
+	
 	private DeclarationAnnotationElementAdapter<String> nameDeclarationAdapter;
 	private AnnotationElementAdapter<String> nameAdapter;
 	private String name;
@@ -65,7 +51,6 @@
 	private String strategy;
 	private TextRange strategyTextRange;
 
-	final Vector<NestableParameterAnnotation> parameters = new Vector<NestableParameterAnnotation>();
 	final ParametersAnnotationContainer parametersContainer = new ParametersAnnotationContainer();
 
 	/**
@@ -81,63 +66,36 @@
 		this.strategyAdapter = buildStrategyAdapter();
 	}
 
+	@Override
 	public void initialize(CompilationUnit astRoot) {
 		this.name = this.buildName(astRoot);
 		this.nameTextRange = this.buildNameTextRange(astRoot);
 		this.strategy = this.buildStrategy(astRoot);
 		this.strategyTextRange = this.buildStrategyTextRange(astRoot);
-		AnnotationContainerTools.initialize(this.parametersContainer, astRoot);
+		this.parametersContainer.initializeFromContainerAnnotation(this.getAstAnnotation(astRoot));
 	}
 
+	@Override
 	public void synchronizeWith(CompilationUnit astRoot) {
 		this.syncName(this.buildName(astRoot));
 		this.nameTextRange = this.buildNameTextRange(astRoot);
 		this.syncStrategy(this.buildStrategy(astRoot));
 		this.strategyTextRange = this.buildStrategyTextRange(astRoot);
-		AnnotationContainerTools.synchronize(this.parametersContainer, astRoot);
+		this.parametersContainer.synchronize(this.getAstAnnotation(astRoot));
 	}
-	
-	@Override
-	public void storeOn(Map<String, Object> map) {
-		super.storeOn(map);
 
-		map.put(NAME_PROPERTY, this.name);
-		this.name = null;
-		map.put(STRATEGY_PROPERTY, this.strategy);
-		this.strategy = null;
-
-		List<Map<String, Object>> paramStaet = this.buildStateList(this.parameters.size());
-		for (NestableParameterAnnotation param : nestableParameters()) {
-			Map<String, Object> hintState = new HashMap<String, Object>();
-			param.storeOn(hintState);
-			paramStaet.add(hintState);
-		}
-		map.put(PARAMETERS_LIST, paramStaet);
-		this.parameters.clear();
-	}
-
 	@Override
-	public void restoreFrom(Map<String, Object> map) {
-		super.restoreFrom(map);
-
-		this.setName((String) map.get(NAME_PROPERTY));
-		this.setStrategy((String) map.get(STRATEGY_PROPERTY));
-
-		@SuppressWarnings("unchecked")
-		List<Map<String, Object>> paramsState = (List<Map<String, Object>>) map.get(PARAMETERS_LIST);
-		for (Map<String, Object> paramState : paramsState) {
-			this.addParameter().restoreFrom(paramState);
-		}
-	}
-
 	public String getAnnotationName() {
 		return ANNOTATION_NAME;
 	}
 
+	// ***** strategy
+	@Override
 	public String getStrategy() {
 		return this.strategy;
 	}
 
+	@Override
 	public void setStrategy(String newStrategy) {
 		if (attributeValueHasChanged(this.strategy, newStrategy)) {
 			this.strategy = newStrategy;
@@ -150,11 +108,27 @@
 		this.strategy = strategy;
 		this.firePropertyChanged(STRATEGY_PROPERTY, old, strategy);
 	}
+	
+	protected String buildStrategy(CompilationUnit astRoot) {
+		return this.strategyAdapter.getValue(astRoot);
+	}
+	
+	@Override
+	public TextRange getStrategyTextRange(CompilationUnit astRoot) {
+		return this.strategyTextRange;
+	}
+	
+	private TextRange buildStrategyTextRange(CompilationUnit astRoot) {
+		return this.getElementTextRange(this.strategyDeclarationAdapter, astRoot);
+	}
 
+	// ***** name
+	@Override
 	public String getName() {
 		return this.name;
 	}
 
+	@Override
 	public void setName(String name) {
 		if (this.attributeValueHasChanged(this.name, name)) {
 			this.name = name;
@@ -167,8 +141,13 @@
 		this.name = astName;
 		this.firePropertyChanged(NAME_PROPERTY, old, astName);
 	}
+	
+	protected String buildName(CompilationUnit astRoot) {
+		return this.nameAdapter.getValue(astRoot);
+	}
 
-	public TextRange getNameTextRange(CompilationUnit astRoot) {
+	@Override
+	public TextRange getNameTextRange() {
 		return this.nameTextRange;
 	}
 
@@ -176,39 +155,36 @@
 		return this.getElementTextRange(this.nameDeclarationAdapter, astRoot);
 	}
 
-	public TextRange getStrategyTextRange(CompilationUnit astRoot) {
-		return this.strategyTextRange;
-	}
-	
-	private TextRange buildStrategyTextRange(CompilationUnit astRoot) {
-		return this.getElementTextRange(this.strategyDeclarationAdapter, astRoot);
-	}
-
+	@Override
 	public Integer getAllocationSize() {
 		return null;
 	}
 
-	public TextRange getAllocationSizeTextRange(CompilationUnit astRoot) {
+	@Override
+	public TextRange getAllocationSizeTextRange() {
 		return null;
 	}
 
+	@Override
 	public Integer getInitialValue() {
 		return null;
 	}
 
-	public TextRange getInitialValueTextRange(CompilationUnit astRoot) {
+	@Override
+	public TextRange getInitialValueTextRange() {
 		return null;
 	}
 
+	@Override
 	public void setAllocationSize(Integer allocationSize) {
 		throw new UnsupportedOperationException();
 	}
 
+	@Override
 	public void setInitialValue(Integer initialValue) {
 		throw new UnsupportedOperationException();
 	}
 
-
 	protected ShortCircuitAnnotationElementAdapter<String> buildNameAdapter() {
 		return new ShortCircuitAnnotationElementAdapter<String>(this.annotatedElement, this.nameDeclarationAdapter);
 	}
@@ -216,96 +192,41 @@
 	protected ShortCircuitAnnotationElementAdapter<String> buildStrategyAdapter() {
 		return new ShortCircuitAnnotationElementAdapter<String>(this.annotatedElement, this.strategyDeclarationAdapter);
 	}
-
-	// ********** java annotations -> persistence model **********
-	protected String buildStrategy(CompilationUnit astRoot) {
-		return this.strategyAdapter.getValue(astRoot);
-	}
-
-	protected String buildName(CompilationUnit astRoot) {
-		return this.nameAdapter.getValue(astRoot);
-	}
-
-
 	//************************ parameters ***********************
-	private NestableParameterAnnotation addParameter() {
-		return this.addParameter(this.parameters.size());
+	@Override
+	public ListIterable<ParameterAnnotation> getParameters() {
+		return this.parametersContainer.getNestedAnnotations();
 	}
 
-	public NestableParameterAnnotation addParameter(int index) {
-		return (NestableParameterAnnotation) AnnotationContainerTools.addNestedAnnotation(index, this.parametersContainer);
+	@Override
+	public int getParametersSize() {
+		return this.parametersContainer.getNestedAnnotationsSize();
 	}
 
-	NestableParameterAnnotation addParameter_() {
-		NestableParameterAnnotation parameter = this.buildParameter(this.parameters.size());
-		this.parameters.add(parameter);
-		return parameter;
+	@Override
+	public ParameterAnnotation parameterAt(int index) {
+		return this.parametersContainer.getNestedAnnotation(index);
 	}
 
-	NestableParameterAnnotation buildParameter(int index) {
-		return SourceParameterAnnotation.createParameter(this, this.annotatedElement, this.daa, Hibernate.GENERIC_GENERATOR__PARAMETERS, index);
+	@Override
+	public ParameterAnnotation addParameter(int index) {
+		return this.parametersContainer.addNestedAnnotation(index);
 	}
 
-	Iterable<NestableParameterAnnotation> nestableParameters() {
-		return this.parameters;
-	}
-
-	void syncAddParameterAnnotation(org.eclipse.jdt.core.dom.Annotation nestedAnnotation) {
-		NestableParameterAnnotation parameter = this.addParameter_();
-		parameter.initialize((CompilationUnit) nestedAnnotation.getRoot());
-		this.fireItemAdded(PARAMETERS_LIST, parametersSize() - 1, parameter);
-	}
-
-	NestableParameterAnnotation moveParameter_(int targetIndex, int sourceIndex) {
-		return CollectionTools.move(this.parameters, targetIndex, sourceIndex).get(targetIndex);
-	}
-
-	void parameterMoved(int targetIndex, int sourceIndex) {
-		this.fireItemMoved(PARAMETERS_LIST, targetIndex, sourceIndex);
-	}
-
-	public int indexOfParameter(ParameterAnnotation parameter) {
-		return this.parameters.indexOf(parameter);
-	}
-
+	@Override
 	public void moveParameter(int targetIndex, int sourceIndex) {
-		AnnotationContainerTools.moveNestedAnnotation(targetIndex, sourceIndex, this.parametersContainer);
+		this.parametersContainer.moveNestedAnnotation(targetIndex, sourceIndex);
 	}
-
-	public ParameterAnnotation parameterAt(int index) {
-		return this.parameters.get(index);
-	}
-
-	public ListIterator<ParameterAnnotation> parameters() {
-		return new CloneListIterator<ParameterAnnotation>(this.parameters);
-	}
-
-	public int parametersSize() {
-		return this.parameters.size();
-	}
-
+	
+	@Override
 	public void removeParameter(int index) {
-		AnnotationContainerTools.removeNestedAnnotation(index, this.parametersContainer);
+		this.parametersContainer.removeNestedAnnotation(index);
 	}
 
-	NestableParameterAnnotation removeParameter_(int index) {
-		return this.parameters.remove(index);
+	ParameterAnnotation buildParameter(int index) {
+		return SourceParameterAnnotation.createParameter(this, this.annotatedElement, this.daa, Hibernate.GENERIC_GENERATOR__PARAMETERS, index);
 	}
 
-	void parameterRemoved(int index) {
-		this.removeItemsFromList(index, this.parameters, PARAMETERS_LIST);
-	}
-
-	// ********** NestableAnnotation implementation **********
-
-	/**
-	 * convenience implementation of method from NestableAnnotation interface
-	 * for subclasses
-	 */
-	public void moveAnnotation(int newIndex) {
-		this.getIndexedAnnotationAdapter().moveAnnotation(newIndex);
-	}
-
 	// ********** misc **********
 
 	@Override
@@ -313,24 +234,10 @@
 		return super.isUnset() &&
 				(this.name == null) &&
 				(this.strategy == null) &&
-				this.parameters.isEmpty();
+				this.parametersContainer.isEmpty();
 	}
 
 	@Override
-	protected void rebuildAdapters() {
-		super.rebuildAdapters();
-		this.nameDeclarationAdapter = this.buildNameDeclarationAdapter();
-		this.nameAdapter = this.buildNameAdapter();
-		this.strategyDeclarationAdapter = this.buildStrategyDeclarationAdapter();
-		this.strategyAdapter = this.buildStrategyAdapter();
-	}
-
-	@Override
-	public IndexedAnnotationAdapter getIndexedAnnotationAdapter() {
-		return (IndexedAnnotationAdapter) this.annotationAdapter;
-	}
-
-	@Override
 	public void toString(StringBuilder sb) {
 		super.toString(sb);
 		sb.append(this.name);
@@ -348,134 +255,49 @@
 	 * adapt the AnnotationContainer interface to the override's join columns
 	 */
 	class ParametersAnnotationContainer
-	implements AnnotationContainer<NestableParameterAnnotation>
+		extends AnnotationContainer<ParameterAnnotation>
 	{
-		public String getContainerAnnotationName() {
-			return GenericGeneratorAnnotationImpl.this.getAnnotationName();
+		@Override
+		protected String getNestedAnnotationsListName() {
+			return PARAMETERS_LIST;
 		}
-
-		public org.eclipse.jdt.core.dom.Annotation getAstAnnotation(CompilationUnit astRoot) {
-			return GenericGeneratorAnnotationImpl.this.getAstAnnotation(astRoot);
-		}
-
-		public String getElementName() {
+		@Override
+		protected String getElementName() {
 			return Hibernate.GENERIC_GENERATOR__PARAMETERS;
 		}
-
 		public String getNestedAnnotationName() {
 			return ParameterAnnotation.ANNOTATION_NAME;
 		}
-
-		public Iterable<NestableParameterAnnotation> getNestedAnnotations() {
-			return GenericGeneratorAnnotationImpl.this.nestableParameters();
-		}
-
-		public int getNestedAnnotationsSize() {
-			return GenericGeneratorAnnotationImpl.this.parametersSize();
-		}
-
-		public NestableParameterAnnotation addNestedAnnotation() {
-			return GenericGeneratorAnnotationImpl.this.addParameter_();
-		}
-
-		public void syncAddNestedAnnotation(org.eclipse.jdt.core.dom.Annotation nestedAnnotation) {
-			GenericGeneratorAnnotationImpl.this.syncAddParameterAnnotation(nestedAnnotation);
-		}
-
-		public NestableParameterAnnotation moveNestedAnnotation(int targetIndex, int sourceIndex) {
-			return GenericGeneratorAnnotationImpl.this.moveParameter_(targetIndex, sourceIndex);
-		}
-
-		public NestableParameterAnnotation removeNestedAnnotation(int index) {
-			return GenericGeneratorAnnotationImpl.this.removeParameter_(index);
-		}
-
-		public void syncRemoveNestedAnnotations(int index) {
-			GenericGeneratorAnnotationImpl.this.parameterRemoved(index);
-		}
-
 		@Override
-		public String toString() {
-			return StringTools.buildToStringFor(this);
+		protected ParameterAnnotation buildNestedAnnotation(int index) {
+			return GenericGeneratorAnnotationImpl.this.buildParameter(index);
 		}
-
 	}
 
-	public static GenericGeneratorAnnotation createNestedGenericGenerator(
-			JavaResourceNode parent, AnnotatedElement element,
-			int index, DeclarationAnnotationAdapter attributeOverridesAdapter) {
-		IndexedDeclarationAnnotationAdapter idaa = buildNestedHibernateDeclarationAnnotationAdapter(index, attributeOverridesAdapter);
-		IndexedAnnotationAdapter annotationAdapter = new ElementIndexedAnnotationAdapter(element, idaa);
-		return new GenericGeneratorAnnotationImpl(parent, element, idaa, annotationAdapter);
+	public static NestableAnnotation buildGenericGeneratorAnnotation(
+			JavaResourceAnnotatedElement parent,
+			AnnotatedElement annotatedElement, int index) {
+		IndexedDeclarationAnnotationAdapter idaa = buildGnericGeneratorDeclarationAnnotationAdapter(index);
+		IndexedAnnotationAdapter iaa = buildGenericGeneratorAnnotationAdapter(annotatedElement, idaa);
+		return new GenericGeneratorAnnotationImpl(
+			parent,
+			annotatedElement,
+			idaa,
+			iaa);
 	}
-
-	private static IndexedDeclarationAnnotationAdapter buildNestedHibernateDeclarationAnnotationAdapter(int index, DeclarationAnnotationAdapter hibernateGenericGeneratorsAdapter) {
-		return new NestedIndexedDeclarationAnnotationAdapter(hibernateGenericGeneratorsAdapter, index, Hibernate.GENERIC_GENERATOR);
+	
+	protected static IndexedAnnotationAdapter buildGenericGeneratorAnnotationAdapter(AnnotatedElement annotatedElement, IndexedDeclarationAnnotationAdapter idaa) {
+		return new ElementIndexedAnnotationAdapter(annotatedElement, idaa);
 	}
 	
-	/*
-	 * This is a workaround fix for https://bugs.eclipse.org/bugs/show_bug.cgi?id=357224
-	 * The exception occurs due to wrong cast in SourceAnnotation
-	 * The method should be removed after the bug fix.
-	 */
-	public void convertToStandAlone() {
-		Map<String, Object> map = new HashMap<String, Object>();
-		this.storeOn(map);
-		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();
-		((JavaResourceAnnotatedElement)this.parent).addStandAloneAnnotation((NestableAnnotation) this);
-		this.newAnnotation();
-		this.restoreFrom(map);
+	private static IndexedDeclarationAnnotationAdapter buildGnericGeneratorDeclarationAnnotationAdapter(int index) {
+		IndexedDeclarationAnnotationAdapter idaa =
+				new CombinationIndexedDeclarationAnnotationAdapter(
+						DECLARATION_ANNOTATION_ADAPTER,
+						CONTAINER_DECLARATION_ANNOTATION_ADAPTER,
+						index,
+						ANNOTATION_NAME);
+		return idaa;
 	}
 
-	public static class GenericGeneratorAnnotationDefinition implements AnnotationDefinition
-	{
-		// singleton
-		private static final GenericGeneratorAnnotationDefinition INSTANCE = new GenericGeneratorAnnotationDefinition();
-
-		/**
-		 * Return the singleton.
-		 */
-		public static AnnotationDefinition instance() {
-			return INSTANCE;
-		}
-
-		/**
-		 * Ensure non-instantiability.
-		 */
-		private GenericGeneratorAnnotationDefinition() {
-			super();
-		}
-
-		public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement member) {
-			return new GenericGeneratorAnnotationImpl(parent, member, DECLARATION_ANNOTATION_ADAPTER, new ElementAnnotationAdapter(member, DECLARATION_ANNOTATION_ADAPTER));
-		}
-
-		public String getAnnotationName() {
-			return GenericGeneratorAnnotation.ANNOTATION_NAME;
-		}
-
-		public Annotation buildAnnotation(JavaResourcePersistentMember arg0,
-				IAnnotation arg1) {
-			throw new UnsupportedOperationException();
-		}
-
-		public Annotation buildNullAnnotation(JavaResourcePersistentMember arg0) {
-			throw new UnsupportedOperationException();
-		}
-
-		public Annotation buildAnnotation(JavaResourceAnnotatedElement parent,
-				IAnnotation jdtAnnotation) {
-			throw new UnsupportedOperationException();
-		}
-
-		public Annotation buildNullAnnotation(
-				JavaResourceAnnotatedElement parent) {
-			throw new UnsupportedOperationException();
-		}
-	}
-
-
 }

Deleted: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/GenericGeneratorsAnnotation.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/GenericGeneratorsAnnotation.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/GenericGeneratorsAnnotation.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008-2009 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.jboss.tools.hibernate.jpt.core.internal.resource.java;
-
-import org.eclipse.jpt.jpa.core.resource.java.ContainerAnnotation;
-import org.jboss.tools.hibernate.jpt.core.internal.context.basic.Hibernate;
-
-/**
- * @author Dmitry Geraskov
- *
- */
-public interface GenericGeneratorsAnnotation extends
-		ContainerAnnotation<GenericGeneratorAnnotation> {
-	
-	String ANNOTATION_NAME = Hibernate.GENERIC_GENERATORS;
-
-	String GENERIC_GENERATORS_LIST = "genericGenerators"; //$NON-NLS-1$
-
-
-}

Added: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/GenericGeneratorsAnnotationDefinition.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/GenericGeneratorsAnnotationDefinition.java	                        (rev 0)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/GenericGeneratorsAnnotationDefinition.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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.jboss.tools.hibernate.jpt.core.internal.resource.java;
+
+import org.eclipse.jdt.core.IAnnotation;
+import org.eclipse.jpt.common.core.internal.resource.java.source.SourceNamedAnnotation;
+import org.eclipse.jpt.common.core.resource.java.Annotation;
+import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
+import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
+import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
+import org.jboss.tools.hibernate.jpt.core.internal.context.basic.Hibernate;
+
+/**
+ * @author Dmitry Geraskov
+ *
+ */
+public class GenericGeneratorsAnnotationDefinition implements
+		AnnotationDefinition {
+	
+	// singleton
+	private static final AnnotationDefinition INSTANCE = new GenericGeneratorsAnnotationDefinition();
+
+	/**
+	 * Return the singleton.
+	 */
+	public static AnnotationDefinition instance() {
+		return INSTANCE;
+	}
+
+	/**
+	 * Ensure single instance.
+	 */
+	private GenericGeneratorsAnnotationDefinition() {
+		super();
+	}
+
+	@Override
+	public String getAnnotationName() {
+		return Hibernate.GENERIC_GENERATORS;
+	}
+
+	@Override
+	public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
+		return new SourceNamedAnnotation(parent, annotatedElement, getAnnotationName());
+	}
+
+	@Override
+	public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
+		throw new UnsupportedOperationException();
+	}
+
+	@Override
+	public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
+		throw new UnsupportedOperationException();
+	}
+
+}

Deleted: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateNamedNativeQueriesAnnotation.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateNamedNativeQueriesAnnotation.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateNamedNativeQueriesAnnotation.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 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.jboss.tools.hibernate.jpt.core.internal.resource.java;
-
-import org.eclipse.jpt.jpa.core.resource.java.ContainerAnnotation;
-import org.jboss.tools.hibernate.jpt.core.internal.context.basic.Hibernate;
-
-/**
- * @author Dmitry Geraskov
- *
- */
-public interface HibernateNamedNativeQueriesAnnotation extends
-		ContainerAnnotation<HibernateNamedNativeQueryAnnotation> {
-
-	String ANNOTATION_NAME = Hibernate.NAMED_NATIVE_QUERIES;
-
-	String HIBERNATE_NAMED_NATIVE_QUERIES_LIST = "hibernateNamedNativeQueries"; //$NON-NLS-1$
-
-	
-}

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateNamedNativeQueriesAnnotationDefinition.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateNamedNativeQueriesAnnotationDefinition.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateNamedNativeQueriesAnnotationDefinition.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -11,10 +11,12 @@
 package org.jboss.tools.hibernate.jpt.core.internal.resource.java;
 
 import org.eclipse.jdt.core.IAnnotation;
+import org.eclipse.jpt.common.core.internal.resource.java.source.SourceNamedAnnotation;
+import org.eclipse.jpt.common.core.resource.java.Annotation;
+import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
+import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
 import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jpa.core.resource.java.Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceAnnotatedElement;
+import org.jboss.tools.hibernate.jpt.core.internal.context.basic.Hibernate;
 
 /**
  * @author Dmitry Geraskov
@@ -39,21 +41,23 @@
 		super();
 	}
 
-	public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
-		return new HibernateSourceNamedNativeQueriesAnnotation(parent, annotatedElement);
+	@Override
+	public String getAnnotationName() {
+		return Hibernate.NAMED_NATIVE_QUERIES;
 	}
 
-	public Annotation buildAnnotation(JavaResourceAnnotatedElement parent,
-			IAnnotation jdtAnnotation) {
-		throw new UnsupportedOperationException();
+	@Override
+	public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
+		return new SourceNamedAnnotation(parent, annotatedElement, getAnnotationName());
 	}
 
+	@Override
 	public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
 		throw new UnsupportedOperationException();
 	}
 
-	public String getAnnotationName() {
-		return HibernateNamedNativeQueriesAnnotation.ANNOTATION_NAME;
+	@Override
+	public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
+		throw new UnsupportedOperationException();
 	}
-
 }

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateNamedNativeQueryAnnotation.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateNamedNativeQueryAnnotation.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateNamedNativeQueryAnnotation.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -11,7 +11,6 @@
 package org.jboss.tools.hibernate.jpt.core.internal.resource.java;
 
 import org.eclipse.jpt.jpa.core.resource.java.NamedNativeQueryAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.NestableNamedNativeQueryAnnotation;
 import org.jboss.tools.hibernate.jpt.core.internal.context.basic.Hibernate;
 
 /**
@@ -21,7 +20,7 @@
  *         org.hibernate.annotations.NamedNativeQuery
  */
 public interface HibernateNamedNativeQueryAnnotation extends
-		NestableNamedNativeQueryAnnotation, HibernateQueryAnnotation, NamedNativeQueryAnnotation {
+		HibernateQueryAnnotation, NamedNativeQueryAnnotation {
 	// replace with Hibernate annotation
 	String ANNOTATION_NAME = Hibernate.NAMED_NATIVE_QUERY;
 

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateNamedNativeQueryAnnotationDefinition.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateNamedNativeQueryAnnotationDefinition.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateNamedNativeQueryAnnotationDefinition.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -11,20 +11,20 @@
 package org.jboss.tools.hibernate.jpt.core.internal.resource.java;
 
 import org.eclipse.jdt.core.IAnnotation;
+import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
+import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
+import org.eclipse.jpt.common.core.resource.java.NestableAnnotationDefinition;
 import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jpa.core.resource.java.Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceAnnotatedElement;
 import org.jboss.tools.hibernate.jpt.core.internal.context.basic.Hibernate;
 
 /**
  * @author Dmitry Geraskov
  *
  */
-public class HibernateNamedNativeQueryAnnotationDefinition implements AnnotationDefinition {
+public class HibernateNamedNativeQueryAnnotationDefinition implements NestableAnnotationDefinition {
 
 	// singleton
-	private static final AnnotationDefinition INSTANCE = new HibernateNamedNativeQueryAnnotationDefinition();
+	private static final NestableAnnotationDefinition INSTANCE = new HibernateNamedNativeQueryAnnotationDefinition();
 
 	/**
 	 * Ensure single instance.
@@ -36,25 +36,36 @@
 	/**
 	 * Return the singleton.
 	 */
-	public static AnnotationDefinition instance() {
+	public static NestableAnnotationDefinition instance() {
 		return INSTANCE;
 	}
 
-	public Annotation buildAnnotation(JavaResourceAnnotatedElement parent,
-			AnnotatedElement annotatedElement) {
-		return HibernateSourceNamedNativeQueryAnnotation.createNamedNativeQuery(parent, annotatedElement);
+	@Override
+	public NestableAnnotation buildAnnotation(JavaResourceAnnotatedElement parent,
+			AnnotatedElement annotatedElement, int index) {
+		return HibernateSourceNamedNativeQueryAnnotation.buildHibernateSourceNamedNativeQueryAnnotation(parent, annotatedElement, index);
 	}
 
-	public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
+	@Override
+	public NestableAnnotation buildAnnotation(
+			JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation,
+			int index) {
 		throw new UnsupportedOperationException();
 	}
-
-	public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
-		//TODO return new HibernateBinaryNamedQueryAnnotation(parent, jdtAnnotation);
-		throw new UnsupportedOperationException();
-	}
-
-	public String getAnnotationName() {
+	
+	
+	@Override
+	public String getNestableAnnotationName() {
 		return Hibernate.NAMED_NATIVE_QUERY;
 	}
+	
+	@Override
+	public String getContainerAnnotationName() {
+		return Hibernate.NAMED_NATIVE_QUERIES;
+	}
+	
+	@Override
+	public String getElementName() {
+		return Hibernate.NAMED_NATIVE_QUERIES__VALUE;
+	}
 }

Deleted: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateNamedQueriesAnnotation.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateNamedQueriesAnnotation.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateNamedQueriesAnnotation.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 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.jboss.tools.hibernate.jpt.core.internal.resource.java;
-
-import org.eclipse.jpt.jpa.core.resource.java.ContainerAnnotation;
-import org.jboss.tools.hibernate.jpt.core.internal.context.basic.Hibernate;
-
-/**
- * @author Dmitry Geraskov
- *
- */
-public interface HibernateNamedQueriesAnnotation extends
-		ContainerAnnotation<HibernateNamedQueryAnnotation> {
-	
-	String ANNOTATION_NAME = Hibernate.NAMED_QUERIES;
-
-	String HIBERNATE_NAMED_QUERIES_LIST = "hibernateNamedQueries"; //$NON-NLS-1$
-}

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateNamedQueriesAnnotationDefinition.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateNamedQueriesAnnotationDefinition.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateNamedQueriesAnnotationDefinition.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -11,10 +11,12 @@
 package org.jboss.tools.hibernate.jpt.core.internal.resource.java;
 
 import org.eclipse.jdt.core.IAnnotation;
+import org.eclipse.jpt.common.core.internal.resource.java.source.SourceNamedAnnotation;
+import org.eclipse.jpt.common.core.resource.java.Annotation;
+import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
+import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
 import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jpa.core.resource.java.Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceAnnotatedElement;
+import org.jboss.tools.hibernate.jpt.core.internal.context.basic.Hibernate;
 
 /**
  * @author Dmitry Geraskov
@@ -39,21 +41,24 @@
 		super();
 	}
 
-	public Annotation buildAnnotation(JavaResourceAnnotatedElement parent,
-			AnnotatedElement annotatedElement) {
-		return new HibernateSourceNamedQueriesAnnotation(parent, annotatedElement);
+	@Override
+	public String getAnnotationName() {
+		return Hibernate.NAMED_QUERIES;
 	}
 
+	@Override
+	public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
+		return new SourceNamedAnnotation(parent, annotatedElement, getAnnotationName());
+	}
+
+	@Override
 	public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
 		throw new UnsupportedOperationException();
 	}
 
+	@Override
 	public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
 		throw new UnsupportedOperationException();
 	}
 
-	public String getAnnotationName() {
-		return HibernateNamedQueriesAnnotation.ANNOTATION_NAME;
-	}
-
 }

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateNamedQueryAnnotation.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateNamedQueryAnnotation.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateNamedQueryAnnotation.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2009 Red Hat, Inc.
+ * Copyright (c) 2012 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,
@@ -11,7 +11,6 @@
 package org.jboss.tools.hibernate.jpt.core.internal.resource.java;
 
 import org.eclipse.jpt.jpa.core.resource.java.NamedQueryAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.NestableNamedQueryAnnotation;
 import org.jboss.tools.hibernate.jpt.core.internal.context.basic.Hibernate;
 
 /**
@@ -20,7 +19,7 @@
  * Corresponds to the Hibernate annotation
  * org.hibernate.annotations.NamedQuery
  */
-public interface HibernateNamedQueryAnnotation extends NestableNamedQueryAnnotation, HibernateQueryAnnotation, NamedQueryAnnotation {
+public interface HibernateNamedQueryAnnotation extends HibernateQueryAnnotation, NamedQueryAnnotation {
 	//replace with Hibernate annotation
 	String ANNOTATION_NAME = Hibernate.NAMED_QUERY;
 }

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateNamedQueryAnnotationDefinition.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateNamedQueryAnnotationDefinition.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateNamedQueryAnnotationDefinition.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2009 Red Hat, Inc.
+ * Copyright (c) 2012 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,
@@ -11,10 +11,10 @@
 package org.jboss.tools.hibernate.jpt.core.internal.resource.java;
 
 import org.eclipse.jdt.core.IAnnotation;
+import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
+import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
+import org.eclipse.jpt.common.core.resource.java.NestableAnnotationDefinition;
 import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jpa.core.resource.java.Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceAnnotatedElement;
 import org.jboss.tools.hibernate.jpt.core.internal.context.basic.Hibernate;
 
 
@@ -22,10 +22,10 @@
  * @author Dmitry Geraskov
  *
  */
-public class HibernateNamedQueryAnnotationDefinition implements AnnotationDefinition {
+public class HibernateNamedQueryAnnotationDefinition implements NestableAnnotationDefinition {
 
 	// singleton
-	private static final AnnotationDefinition INSTANCE = new HibernateNamedQueryAnnotationDefinition();
+	private static final NestableAnnotationDefinition INSTANCE = new HibernateNamedQueryAnnotationDefinition();
 
 
 	/**
@@ -38,25 +38,33 @@
 	/**
 	 * Return the singleton.
 	 */
-	public static AnnotationDefinition instance() {
+	public static NestableAnnotationDefinition instance() {
 		return INSTANCE;
 	}
-
-	public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
-		return HibernateSourceNamedQueryAnnotation.createNamedQuery(parent, annotatedElement);
+	
+	@Override
+	public NestableAnnotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement, int index) {
+		return HibernateSourceNamedQueryAnnotation.createNamedQuery(parent, annotatedElement, index);
 	}
-
-	public Annotation buildAnnotation(JavaResourceAnnotatedElement parent,
-			IAnnotation jdtAnnotation) {
+	
+	@Override
+	public NestableAnnotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation, int index) {
 		throw new UnsupportedOperationException();
 	}
-
-	public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
-		throw new UnsupportedOperationException();
-	}
-
-	public String getAnnotationName() {
+	
+	@Override
+	public String getNestableAnnotationName() {
 		return Hibernate.NAMED_QUERY;
 	}
+	
+	@Override
+	public String getContainerAnnotationName() {
+		return Hibernate.NAMED_QUERIES;
+	}
+	
+	@Override
+	public String getElementName() {
+		return Hibernate.NAMED_QUERIES__VALUE;
+	}
 
 }

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateQueryAnnotation.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateQueryAnnotation.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateQueryAnnotation.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -10,9 +10,7 @@
  ******************************************************************************/
 package org.jboss.tools.hibernate.jpt.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.NestableAnnotation;
 import org.eclipse.jpt.jpa.core.resource.java.QueryAnnotation;
 import org.jboss.tools.hibernate.jpt.core.internal.context.CacheModeType;
 import org.jboss.tools.hibernate.jpt.core.internal.context.FlushModeType;
@@ -22,7 +20,7 @@
  *
  * Interface contains Hibernate specific attributes.
  */
-public interface HibernateQueryAnnotation extends NestableAnnotation, QueryAnnotation{
+public interface HibernateQueryAnnotation extends QueryAnnotation{
 
 	//************************ flushMode *********************************
 
@@ -43,7 +41,7 @@
 	 * Return the {@link TextRange} for the 'flushMode' element. If element
 	 * does not exist return the {@link TextRange} for the *NamedQuery annotation.
 	 */
-	TextRange getFlushModeTextRange(CompilationUnit astRoot);
+	TextRange getFlushModeTextRange();
 
 	//************************ cacheMode *********************************
 
@@ -64,7 +62,7 @@
 	 * Return the {@link TextRange} for the 'cacheMode' element. If element
 	 * does not exist return the {@link TextRange} for the *NamedQuery annotation.
 	 */
-	TextRange getCacheModeTextRange(CompilationUnit astRoot);
+	TextRange getCacheModeTextRange();
 
 	//************************ cacheable *********************************
 	Boolean isCacheable();

Deleted: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateSourceNamedNativeQueriesAnnotation.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateSourceNamedNativeQueriesAnnotation.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateSourceNamedNativeQueriesAnnotation.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -1,134 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009-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.jboss.tools.hibernate.jpt.core.internal.resource.java;
-
-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.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneIterable;
-import org.eclipse.jpt.jpa.core.internal.resource.java.source.AnnotationContainerTools;
-import org.eclipse.jpt.jpa.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.jpa.core.resource.java.NestableAnnotation;
-import org.jboss.tools.hibernate.jpt.core.internal.context.basic.Hibernate;
-
-/**
- * @author Dmitry Geraskov
- *
- */
-public class HibernateSourceNamedNativeQueriesAnnotation extends SourceAnnotation<AnnotatedElement> implements
-		HibernateNamedNativeQueriesAnnotation {
-
-	public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
-	private final Vector<HibernateNamedNativeQueryAnnotation> hibernateNamedNativeQueries = new Vector<HibernateNamedNativeQueryAnnotation>();
-
-
-	public HibernateSourceNamedNativeQueriesAnnotation(JavaResourceNode parent, AnnotatedElement 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.hibernateNamedNativeQueries.isEmpty();
-	}
-
-	@Override
-	public void toString(StringBuilder sb) {
-		sb.append(this.hibernateNamedNativeQueries);
-	}
-
-	// ********** AnnotationContainer implementation **********
-	public String getElementName() {
-		return Hibernate.NAMED_NATIVE_QUERIES__VALUE;
-	}
-
-	public String getNestedAnnotationName() {
-		return HibernateNamedNativeQueryAnnotation.ANNOTATION_NAME;
-	}
-
-	public Iterable<HibernateNamedNativeQueryAnnotation> getNestedAnnotations() {
-		return new LiveCloneIterable<HibernateNamedNativeQueryAnnotation>(this.hibernateNamedNativeQueries);
-	}
-
-	public int getNestedAnnotationsSize() {
-		return this.hibernateNamedNativeQueries.size();
-	}
-
-	public void nestStandAloneAnnotation(NestableAnnotation standAloneAnnotation) {
-		this.nestStandAloneAnnotation(standAloneAnnotation, this.hibernateNamedNativeQueries.size());
-	}
-
-	private void nestStandAloneAnnotation(NestableAnnotation standAloneAnnotation, int index) {
-		standAloneAnnotation.convertToNested(this, this.daa, index);
-	}
-
-	public void addNestedAnnotation(int index, NestableAnnotation annotation) {
-		this.hibernateNamedNativeQueries.add(index, (HibernateNamedNativeQueryAnnotation) annotation);
-	}
-
-	public void convertLastNestedAnnotationToStandAlone() {
-		this.hibernateNamedNativeQueries.remove(0).convertToStandAlone();
-	}
-
-	public HibernateNamedNativeQueryAnnotation addNestedAnnotation() {
-		return this.addNestedAnnotation(this.hibernateNamedNativeQueries.size());
-	}
-
-	private HibernateNamedNativeQueryAnnotation addNestedAnnotation(int index) {
-		HibernateNamedNativeQueryAnnotation namedNativeQuery = this.buildHibernateNamedNativeQuery(index);
-		this.hibernateNamedNativeQueries.add(namedNativeQuery);
-		return namedNativeQuery;
-	}
-
-	public void syncAddNestedAnnotation(Annotation astAnnotation) {
-		int index = this.hibernateNamedNativeQueries.size();
-		HibernateNamedNativeQueryAnnotation namedNativeQuery = this.addNestedAnnotation(index);
-		namedNativeQuery.initialize((CompilationUnit) astAnnotation.getRoot());
-		this.fireItemAdded(HIBERNATE_NAMED_NATIVE_QUERIES_LIST, index, namedNativeQuery);
-	}
-
-	private HibernateNamedNativeQueryAnnotation buildHibernateNamedNativeQuery(int index) {
-		return HibernateSourceNamedNativeQueryAnnotation.createNestedHibernateNamedNativeQuery(this.parent, this.annotatedElement, index, this.daa);
-	}
-
-	public HibernateNamedNativeQueryAnnotation moveNestedAnnotation(int targetIndex, int sourceIndex) {
-		return CollectionTools.move(this.hibernateNamedNativeQueries, targetIndex, sourceIndex).get(targetIndex);
-	}
-
-	public HibernateNamedNativeQueryAnnotation removeNestedAnnotation(int index) {
-		return this.hibernateNamedNativeQueries.remove(index);
-	}
-
-	public void syncRemoveNestedAnnotations(int index) {
-		this.removeItemsFromList(index, this.hibernateNamedNativeQueries, HIBERNATE_NAMED_NATIVE_QUERIES_LIST);
-	}
-
-}

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateSourceNamedNativeQueryAnnotation.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateSourceNamedNativeQueryAnnotation.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateSourceNamedNativeQueryAnnotation.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -10,20 +10,19 @@
  ******************************************************************************/
 package org.jboss.tools.hibernate.jpt.core.internal.resource.java;
 
-import java.util.HashMap;
-import java.util.ListIterator;
-import java.util.Map;
-
 import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
 import org.eclipse.jpt.common.core.internal.utility.jdt.ASTTools;
+import org.eclipse.jpt.common.core.internal.utility.jdt.CombinationIndexedDeclarationAnnotationAdapter;
 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.EnumDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.NestedIndexedDeclarationAnnotationAdapter;
 import org.eclipse.jpt.common.core.internal.utility.jdt.ShortCircuitAnnotationElementAdapter;
 import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
 import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleTypeStringExpressionConverter;
+import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
+import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
 import org.eclipse.jpt.common.core.utility.TextRange;
 import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
 import org.eclipse.jpt.common.core.utility.jdt.AnnotationAdapter;
@@ -32,12 +31,8 @@
 import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
 import org.eclipse.jpt.common.core.utility.jdt.IndexedAnnotationAdapter;
 import org.eclipse.jpt.common.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.utility.internal.iterators.EmptyListIterator;
-import org.eclipse.jpt.jpa.core.internal.resource.java.source.SourceAnnotation;
-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;
-import org.eclipse.jpt.jpa.core.resource.java.NestableQueryHintAnnotation;
+import org.eclipse.jpt.common.utility.internal.iterables.EmptyListIterable;
+import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
 import org.eclipse.jpt.jpa.core.resource.java.QueryHintAnnotation;
 import org.jboss.tools.hibernate.jpt.core.internal.context.CacheModeType;
 import org.jboss.tools.hibernate.jpt.core.internal.context.FlushModeType;
@@ -48,11 +43,13 @@
  * @author Dmitry Geraskov
  *
  */
-public class HibernateSourceNamedNativeQueryAnnotation extends SourceAnnotation<AnnotatedElement> implements
+public class HibernateSourceNamedNativeQueryAnnotation extends SourceAnnotation implements
 		HibernateNamedNativeQueryAnnotation {
 
 	public static final SimpleDeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
+	private static final DeclarationAnnotationAdapter CONTAINER_DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(Hibernate.NAMED_NATIVE_QUERIES);
 
+	
 	private DeclarationAnnotationElementAdapter<String> nameDeclarationAdapter;
 	private AnnotationElementAdapter<String> nameAdapter;
 	private String name;
@@ -66,10 +63,12 @@
 	private DeclarationAnnotationElementAdapter<String> flushModeDeclarationAdapter;
 	private AnnotationElementAdapter<String> flushModeAdapter;
 	private FlushModeType flushMode;
+	TextRange flushModeTextRange;
 
 	private DeclarationAnnotationElementAdapter<String> cacheModeDeclarationAdapter;
 	private AnnotationElementAdapter<String> cacheModeAdapter;
 	private CacheModeType cacheMode;
+	TextRange cacheModeTextRange;
 
 	private DeclarationAnnotationElementAdapter<Boolean> cacheableDeclarationAdapter;
 	private AnnotationElementAdapter<Boolean> cacheableAdapter;
@@ -102,6 +101,7 @@
 	private DeclarationAnnotationElementAdapter<String> resultClassDeclarationAdapter;
 	private AnnotationElementAdapter<String> resultClassAdapter;
 	private String resultClass;
+	TextRange resultClassTextRange;
 
 	/**
 	 * @see org.eclipse.jpt.jpa.core.internal.resource.java.source.SourceIdClassAnnotation#fullyQualifiedClassName
@@ -113,6 +113,7 @@
 	private DeclarationAnnotationElementAdapter<String> resultSetMappingDeclarationAdapter;
 	private AnnotationElementAdapter<String> resultSetMappingAdapter;
 	private String resultSetMapping;
+	private TextRange resultSetMappingTextRange;
 
 	HibernateSourceNamedNativeQueryAnnotation(JavaResourceNode parent, AnnotatedElement annotatedElement,DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
 		super(parent, annotatedElement, daa, annotationAdapter);
@@ -156,7 +157,9 @@
 		this.query = this.buildQuery(astRoot);
 		this.queryTextRange = this.buildQueryTextRange(astRoot);
 		this.flushMode = this.buildFlushMode(astRoot);
+		this.flushModeTextRange =  this.buildFlushModeTextRange(astRoot);
 		this.cacheMode = this.buildCacheMode(astRoot);
+		this.cacheModeTextRange = this.buildCacheModeTextRange(astRoot);
 		this.cacheable = this.buildCacheable(astRoot);
 		this.cacheRegion = this.buildCacheRegion(astRoot);
 		this.fetchSize = this.buildFetchSize(astRoot);
@@ -165,7 +168,9 @@
 		this.readOnly = this.buildReadOnly(astRoot);
 		this.callable = this.buildCallable(astRoot);
 		this.resultClass = this.buildResultClass(astRoot);
+		this.resultClassTextRange = this.buildResultClassTextRange(astRoot);
 		this.resultSetMapping = this.buildResultSetMapping(astRoot);
+		this.resultSetMappingTextRange = this.buildResultSetMappingTextRange(astRoot);
 	}
 
 	@Override
@@ -175,7 +180,9 @@
 		this.syncQuery(this.buildQuery(astRoot));
 		this.queryTextRange = this.buildQueryTextRange(astRoot);
 		this.syncFlushMode(this.buildFlushMode(astRoot));
+		this.flushModeTextRange =  this.buildFlushModeTextRange(astRoot);
 		this.syncCacheMode(this.buildCacheMode(astRoot));
+		this.cacheModeTextRange = this.buildCacheModeTextRange(astRoot);
 		this.syncCacheable(this.buildCacheable(astRoot));
 		this.syncCacheRegion(this.buildCacheRegion(astRoot));
 		this.syncFetchSize(this.buildFetchSize(astRoot));
@@ -184,7 +191,9 @@
 		this.syncReadOnly(this.buildReadOnly(astRoot));
 		this.syncCallable(this.buildCallable(astRoot));
 		this.syncResultClass(this.buildResultClass(astRoot));
+		this.resultClassTextRange = this.buildResultClassTextRange(astRoot);
 		this.syncResultSetMapping(this.buildResultSetMapping(astRoot));
+		this.resultSetMappingTextRange = this.buildResultSetMappingTextRange(astRoot);
 	}
 
 
@@ -223,7 +232,7 @@
 	}
 
 	@Override
-	public TextRange getNameTextRange(CompilationUnit astRoot) {
+	public TextRange getNameTextRange() {
 		return this.nameTextRange;
 	}
 
@@ -256,7 +265,7 @@
 	}
 
 	@Override
-	public TextRange getQueryTextRange(CompilationUnit astRoot) {
+	public TextRange getQueryTextRange() {
 		return this.queryTextRange;
 	}
 	
@@ -266,42 +275,33 @@
 
 	// ***** hints
 	@Override
-	public ListIterator<QueryHintAnnotation> hints() {
-		return EmptyListIterator.instance();
+	public ListIterable<QueryHintAnnotation> getHints() {
+		return EmptyListIterable.instance();
 	}
 
-	ListIterator<NestableQueryHintAnnotation> nestableHints() {
-		return EmptyListIterator.instance();
-	}
-
 	@Override
-	public int hintsSize() {
+	public int getHintsSize() {
 		return 0;
 	}
 
 	@Override
-	public NestableQueryHintAnnotation hintAt(int index) {
-		throw new UnsupportedOperationException();
+	public QueryHintAnnotation hintAt(int index) {
+		return null;
 	}
 
 	@Override
-	public int indexOfHint(QueryHintAnnotation queryHint) {
-		return -1;
-	}
-
-	@Override
-	public NestableQueryHintAnnotation addHint(int index) {
+	public QueryHintAnnotation addHint(int index) {
 		return null;
 	}
 
 	@Override
 	public void moveHint(int targetIndex, int sourceIndex) {
-		//AnnotationContainerTools.moveNestedAnnotation(targetIndex, sourceIndex, this.hintsContainer);
+		//nothing to do
 	}
 
 	@Override
 	public void removeHint(int index) {
-		//AnnotationContainerTools.removeNestedAnnotation(index, this.hintsContainer);
+		//nothing to do
 	}
 
 	// ******************** HibernateNamedNativeQueryAnnotation implementation *************
@@ -330,10 +330,14 @@
 		return FlushModeType.fromJavaAnnotationValue(this.flushModeAdapter.getValue(astRoot));
 	}
 
-	@Override
-	public TextRange getFlushModeTextRange(CompilationUnit astRoot) {
+	protected TextRange buildFlushModeTextRange(CompilationUnit astRoot) {
 		return this.getElementTextRange(this.flushModeDeclarationAdapter, astRoot);
 	}
+	
+	@Override
+	public TextRange getFlushModeTextRange() {
+		return this.flushModeTextRange;
+	}
 
 	// ***** caheMode
 
@@ -359,10 +363,14 @@
 	private CacheModeType buildCacheMode(CompilationUnit astRoot) {
 		return CacheModeType.fromJavaAnnotationValue(this.cacheModeAdapter.getValue(astRoot));
 	}
-
+	
+	protected TextRange buildCacheModeTextRange(CompilationUnit astRoot) {
+		return this.getElementTextRange(this.flushModeDeclarationAdapter, astRoot);
+	}
+	
 	@Override
-	public TextRange getCacheModeTextRange(CompilationUnit astRoot) {
-		return this.getElementTextRange(this.cacheModeDeclarationAdapter, astRoot);
+	public TextRange getCacheModeTextRange() {
+		return this.cacheModeTextRange;
 	}
 
 	//************************ cacheable *********************************
@@ -553,9 +561,13 @@
 	}
 
 	@Override
-	public TextRange getResultClassTextRange(CompilationUnit astRoot) {
-		return this.getElementTextRange(this.resultClassDeclarationAdapter, astRoot);
+	public TextRange getResultClassTextRange() {
+		return resultClassTextRange;
 	}
+	
+	private TextRange buildResultClassTextRange(CompilationUnit astRoot) {
+		return this.getElementTextRange(this.nameDeclarationAdapter, astRoot);
+	}
 
 	// ***** fully-qualified result class name
 	@Override
@@ -600,63 +612,15 @@
 	}
 
 	@Override
-	public TextRange getResultSetMappingTextRange(CompilationUnit astRoot) {
+	public TextRange getResultSetMappingTextRange() {
+		return this.resultSetMappingTextRange;
+	}
+
+	private TextRange buildResultSetMappingTextRange(CompilationUnit astRoot) {
 		return this.getElementTextRange(this.resultSetMappingDeclarationAdapter, astRoot);
 	}
 	// ********** NestableAnnotation implementation **********
-
 	@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;
-		map.put(FLUSH_MODE_PROPERTY, this.flushMode);
-		this.flushMode = null;
-		map.put(CACHE_MODE_PROPERTY, this.cacheMode);
-		this.cacheMode = null;
-		map.put(CACHEABLE_PROPERTY, this.cacheable);
-		this.cacheable = null;
-		map.put(CACHE_REGION_PROPERTY, this.cacheRegion);
-		this.cacheRegion = null;
-		map.put(FETCH_SIZE_PROPERTY, this.fetchSize);
-		this.fetchSize = null;
-		map.put(TIMEOUT_PROPERTY, this.timeout);
-		this.timeout = null;
-		map.put(COMMENT_PROPERTY, this.comment);
-		this.comment = null;
-		map.put(READ_ONLY_PROPERTY, this.readOnly);
-		this.readOnly = null;
-		map.put(CALLABLE_PROPERTY, this.callable);
-		this.callable = null;
-		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.setName((String) map.get(NAME_PROPERTY));
-		this.setQuery((String) map.get(QUERY_PROPERTY));
-		this.setFlushMode((FlushModeType) map.get(FLUSH_MODE_PROPERTY));
-		this.setCacheMode((CacheModeType) map.get(CACHE_MODE_PROPERTY));
-		this.setCacheable((Boolean) map.get(CACHEABLE_PROPERTY));
-		this.setCacheRegion((String) map.get(CACHE_REGION_PROPERTY));
-		this.setFetchSize((Integer) map.get(FETCH_SIZE_PROPERTY));
-		this.setTimeout((Integer) map.get(TIMEOUT_PROPERTY));
-		this.setComment((String)map.get(COMMENT_PROPERTY));
-		this.setReadOnly((Boolean) map.get(READ_ONLY_PROPERTY));
-		this.setCallable((Boolean) map.get(CALLABLE_PROPERTY));
-		this.setResultClass((String) map.get(RESULT_CLASS_PROPERTY));
-		this.setResultSetMapping((String) map.get(RESULT_SET_MAPPING_PROPERTY));
-	}
-	
-	@Override
 	public boolean isUnset() {
 		return super.isUnset() &&
 				(this.name == null) &&
@@ -670,51 +634,11 @@
 				(this.readOnly == null);
 	}
 
-	@Override
-	protected void rebuildAdapters() {
-		super.rebuildAdapters();
-		this.nameDeclarationAdapter = this.buildNameAdapter(daa);
-		this.nameAdapter = this.buildAdapter(this.nameDeclarationAdapter);
-		this.queryDeclarationAdapter = this.buildQueryAdapter(daa);
-		this.queryAdapter = this.buildAdapter(this.queryDeclarationAdapter);
-		this.flushModeDeclarationAdapter = this.buildFlushModeAdapter(daa);
-		this.flushModeAdapter = new ShortCircuitAnnotationElementAdapter<String>(this.annotatedElement, this.flushModeDeclarationAdapter);
-		this.cacheModeDeclarationAdapter = this.buildCacheModeAdapter(daa);
-		this.cacheModeAdapter = new ShortCircuitAnnotationElementAdapter<String>(this.annotatedElement, this.cacheModeDeclarationAdapter);
-		this.cacheableDeclarationAdapter = this.buildCacheableAdapter(daa);
-		this.cacheableAdapter = new ShortCircuitAnnotationElementAdapter<Boolean>(this.annotatedElement, this.cacheableDeclarationAdapter);
-		this.cacheRegionDeclarationAdapter = this.buildCacheRegionAdapter(daa);
-		this.cacheRegionAdapter = this.buildAdapter(this.cacheRegionDeclarationAdapter);
-		this.fetchSizeDeclarationAdapter = this.buildFetchSizeAdapter(daa);
-		this.fetchSizeAdapter = new ShortCircuitAnnotationElementAdapter<Integer>(this.annotatedElement, this.fetchSizeDeclarationAdapter);
-		this.timeoutDeclarationAdapter = this.buildTimeoutAdapter(daa);
-		this.timeoutAdapter = new ShortCircuitAnnotationElementAdapter<Integer>(this.annotatedElement, this.timeoutDeclarationAdapter);
-		this.commentDeclarationAdapter = this.buildCommentAdapter(daa);
-		this.commentAdapter = new ShortCircuitAnnotationElementAdapter<String>(this.annotatedElement, this.commentDeclarationAdapter);
-		this.readOnlyDeclarationAdapter = this.buildReadOnlyAdapter(daa);
-		this.readOnlyAdapter = new ShortCircuitAnnotationElementAdapter<Boolean>(this.annotatedElement, this.readOnlyDeclarationAdapter);
-		this.callableDeclarationAdapter = this.buildReadOnlyAdapter(daa);
-		this.callableAdapter = new ShortCircuitAnnotationElementAdapter<Boolean>(this.annotatedElement, this.callableDeclarationAdapter);
-		this.resultClassDeclarationAdapter = this.buildResultClassAdapter(daa);
-		this.resultClassAdapter = this.buildAdapter(this.resultClassDeclarationAdapter);
-		this.resultSetMappingDeclarationAdapter = this.buildResultSetMappingAdapter(daa);
-		this.resultSetMappingAdapter = this.buildAdapter(this.resultSetMappingDeclarationAdapter);
-	}
-
 	/**
 	 * convenience implementation of method from NestableAnnotation interface
 	 * for subclasses
 	 */
-	@Override
-	public void moveAnnotation(int newIndex) {
-		this.getIndexedAnnotationAdapter().moveAnnotation(newIndex);
-	}
 
-	@Override
-	public IndexedAnnotationAdapter getIndexedAnnotationAdapter() {
-		return (IndexedAnnotationAdapter) this.annotationAdapter;
-	}
-
 	public static HibernateNamedNativeQueryAnnotation createNamedNativeQuery(JavaResourceNode parent, AnnotatedElement member) {
 		return new HibernateSourceNamedNativeQueryAnnotation(parent, member, DECLARATION_ANNOTATION_ADAPTER, new ElementAnnotationAdapter(member, DECLARATION_ANNOTATION_ADAPTER));
 	}
@@ -777,37 +701,28 @@
 		sb.append(this.name);
 	}
 	
-	/*
-	 * This is a workaround fix for https://bugs.eclipse.org/bugs/show_bug.cgi?id=357224
-	 * The exception occurs due to wrong cast in SourceAnnotation
-	 * The method should be removed after the bug fix.
-	 */
-	public void convertToStandAlone() {
-		Map<String, Object> map = new HashMap<String, Object>();
-		this.storeOn(map);
-		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();
-		((JavaResourceAnnotatedElement)this.parent).addStandAloneAnnotation((NestableAnnotation) this);
-		this.newAnnotation();
-		this.restoreFrom(map);
-	}
-
 	// ********** static methods **********
-
-	public static HibernateSourceNamedNativeQueryAnnotation createHibernateNamedNativeQuery(JavaResourceNode parent, AnnotatedElement member) {
-		return new HibernateSourceNamedNativeQueryAnnotation(parent, member, DECLARATION_ANNOTATION_ADAPTER, new ElementAnnotationAdapter(member, DECLARATION_ANNOTATION_ADAPTER));
+	public static HibernateSourceNamedNativeQueryAnnotation buildHibernateSourceNamedNativeQueryAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement element, int index) {
+		IndexedDeclarationAnnotationAdapter idaa = buildHibernateNamedNativeQueryDeclarationAnnotationAdapter(index);
+		IndexedAnnotationAdapter iaa = buildHibernateNamedNativeQueryAnnotationAdapter(element, idaa);
+		return new HibernateSourceNamedNativeQueryAnnotation(
+			parent,
+			element,
+			idaa,
+			iaa);
 	}
-
-	public static HibernateSourceNamedNativeQueryAnnotation createNestedHibernateNamedNativeQuery(JavaResourceNode parent, AnnotatedElement member, int index, DeclarationAnnotationAdapter attributeOverridesAdapter) {
-		IndexedDeclarationAnnotationAdapter idaa = buildNestedHibernateDeclarationAnnotationAdapter(index, attributeOverridesAdapter);
-		IndexedAnnotationAdapter annotationAdapter = new ElementIndexedAnnotationAdapter(member, idaa);
-		return new HibernateSourceNamedNativeQueryAnnotation(parent, member, idaa, annotationAdapter);
+	
+	private static IndexedAnnotationAdapter buildHibernateNamedNativeQueryAnnotationAdapter(AnnotatedElement annotatedElement, IndexedDeclarationAnnotationAdapter idaa) {
+		return new ElementIndexedAnnotationAdapter(annotatedElement, idaa);
 	}
 
-	private static IndexedDeclarationAnnotationAdapter buildNestedHibernateDeclarationAnnotationAdapter(int index, DeclarationAnnotationAdapter hibernateNamedNativeQueriesAdapter) {
-		return new NestedIndexedDeclarationAnnotationAdapter(hibernateNamedNativeQueriesAdapter, index, Hibernate.NAMED_NATIVE_QUERY);
+	private static IndexedDeclarationAnnotationAdapter buildHibernateNamedNativeQueryDeclarationAnnotationAdapter(int index) {
+		IndexedDeclarationAnnotationAdapter idaa = 
+			new CombinationIndexedDeclarationAnnotationAdapter(
+				DECLARATION_ANNOTATION_ADAPTER,
+				CONTAINER_DECLARATION_ANNOTATION_ADAPTER,
+				index,
+				ANNOTATION_NAME);
+		return idaa;
 	}
-
 }

Deleted: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateSourceNamedQueriesAnnotation.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateSourceNamedQueriesAnnotation.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateSourceNamedQueriesAnnotation.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -1,133 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009-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.jboss.tools.hibernate.jpt.core.internal.resource.java;
-
-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.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneIterable;
-import org.eclipse.jpt.jpa.core.internal.resource.java.source.AnnotationContainerTools;
-import org.eclipse.jpt.jpa.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.jpa.core.resource.java.NestableAnnotation;
-import org.jboss.tools.hibernate.jpt.core.internal.context.basic.Hibernate;
-
-/**
- * @author Dmitry Geraskov
- *
- */
-public class HibernateSourceNamedQueriesAnnotation extends SourceAnnotation<AnnotatedElement> implements
-		HibernateNamedQueriesAnnotation {
-
-	public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
-	private final Vector<HibernateNamedQueryAnnotation> hibernateNamedQueries = new Vector<HibernateNamedQueryAnnotation>();
-
-
-	public HibernateSourceNamedQueriesAnnotation(JavaResourceNode parent, AnnotatedElement 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.hibernateNamedQueries.isEmpty();
-	}
-
-	@Override
-	public void toString(StringBuilder sb) {
-		sb.append(this.hibernateNamedQueries);
-	}
-
-	// ********** AnnotationContainer implementation **********
-	public String getElementName() {
-		return Hibernate.NAMED_QUERIES__VALUE;
-	}
-
-	public String getNestedAnnotationName() {
-		return HibernateNamedQueryAnnotation.ANNOTATION_NAME;
-	}
-
-	public Iterable<HibernateNamedQueryAnnotation> getNestedAnnotations() {
-		return new LiveCloneIterable<HibernateNamedQueryAnnotation>(this.hibernateNamedQueries);
-	}
-
-	public int getNestedAnnotationsSize() {
-		return this.hibernateNamedQueries.size();
-	}
-
-	public void nestStandAloneAnnotation(NestableAnnotation standAloneAnnotation) {
-		this.nestStandAloneAnnotation(standAloneAnnotation, this.hibernateNamedQueries.size());
-	}
-
-	private void nestStandAloneAnnotation(NestableAnnotation standAloneAnnotation, int index) {
-		standAloneAnnotation.convertToNested(this, this.daa, index);
-	}
-
-	public void addNestedAnnotation(int index, NestableAnnotation annotation) {
-		this.hibernateNamedQueries.add(index, (HibernateNamedQueryAnnotation) annotation);
-	}
-
-	public void convertLastNestedAnnotationToStandAlone() {
-		this.hibernateNamedQueries.remove(0).convertToStandAlone();
-	}
-
-	public HibernateNamedQueryAnnotation addNestedAnnotation() {
-		return this.addNestedAnnotation(this.hibernateNamedQueries.size());
-	}
-
-	private HibernateNamedQueryAnnotation addNestedAnnotation(int index) {
-		HibernateNamedQueryAnnotation namedQuery = this.buildHibernateNamedQuery(index);
-		this.hibernateNamedQueries.add(namedQuery);
-		return namedQuery;
-	}
-
-	public void syncAddNestedAnnotation(Annotation astAnnotation) {
-		int index = this.hibernateNamedQueries.size();
-		HibernateNamedQueryAnnotation namedQuery = this.addNestedAnnotation(index);
-		namedQuery.initialize((CompilationUnit) astAnnotation.getRoot());
-		this.fireItemAdded(HIBERNATE_NAMED_QUERIES_LIST, index, namedQuery);
-	}
-
-	private HibernateNamedQueryAnnotation buildHibernateNamedQuery(int index) {
-		return HibernateSourceNamedQueryAnnotation.createNestedHibernateNamedQuery(this.parent, this.annotatedElement, index, this.daa);
-	}
-
-	public HibernateNamedQueryAnnotation moveNestedAnnotation(int targetIndex, int sourceIndex) {
-		return CollectionTools.move(this.hibernateNamedQueries, targetIndex, sourceIndex).get(targetIndex);
-	}
-
-	public HibernateNamedQueryAnnotation removeNestedAnnotation(int index) {
-		return this.hibernateNamedQueries.remove(index);
-	}
-
-	public void syncRemoveNestedAnnotations(int index) {
-		this.removeItemsFromList(index, this.hibernateNamedQueries, HIBERNATE_NAMED_QUERIES_LIST);
-	}
-
-}

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateSourceNamedQueryAnnotation.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateSourceNamedQueryAnnotation.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateSourceNamedQueryAnnotation.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -10,18 +10,15 @@
  ******************************************************************************/
 package org.jboss.tools.hibernate.jpt.core.internal.resource.java;
 
-import java.util.HashMap;
-import java.util.ListIterator;
-import java.util.Map;
-
 import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
+import org.eclipse.jpt.common.core.internal.utility.jdt.CombinationIndexedDeclarationAnnotationAdapter;
 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.EnumDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.NestedIndexedDeclarationAnnotationAdapter;
 import org.eclipse.jpt.common.core.internal.utility.jdt.ShortCircuitAnnotationElementAdapter;
 import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
+import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
 import org.eclipse.jpt.common.core.utility.TextRange;
 import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
 import org.eclipse.jpt.common.core.utility.jdt.AnnotationAdapter;
@@ -30,12 +27,8 @@
 import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
 import org.eclipse.jpt.common.core.utility.jdt.IndexedAnnotationAdapter;
 import org.eclipse.jpt.common.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.utility.internal.iterators.EmptyListIterator;
-import org.eclipse.jpt.jpa.core.internal.resource.java.source.SourceAnnotation;
-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;
-import org.eclipse.jpt.jpa.core.resource.java.NestableQueryHintAnnotation;
+import org.eclipse.jpt.common.utility.internal.iterables.EmptyListIterable;
+import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
 import org.eclipse.jpt.jpa.core.resource.java.QueryHintAnnotation;
 import org.jboss.tools.hibernate.jpt.core.internal.context.CacheModeType;
 import org.jboss.tools.hibernate.jpt.core.internal.context.FlushModeType;
@@ -45,11 +38,12 @@
  * @author Dmitry Geraskov
  *
  */
-public class HibernateSourceNamedQueryAnnotation extends SourceAnnotation<AnnotatedElement>
+public class HibernateSourceNamedQueryAnnotation extends SourceAnnotation
 	implements HibernateNamedQueryAnnotation {
 
-	public static final SimpleDeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
+	public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
+	private static final DeclarationAnnotationAdapter CONTAINER_DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(Hibernate.NAMED_QUERIES);
+	
 	private DeclarationAnnotationElementAdapter<String> nameDeclarationAdapter;
 	private AnnotationElementAdapter<String> nameAdapter;
 	private String name;
@@ -63,10 +57,12 @@
 	private DeclarationAnnotationElementAdapter<String> flushModeDeclarationAdapter;
 	private AnnotationElementAdapter<String> flushModeAdapter;
 	private FlushModeType flushMode;
+	TextRange flushModeTextRange;
 
 	private DeclarationAnnotationElementAdapter<String> cacheModeDeclarationAdapter;
 	private AnnotationElementAdapter<String> cacheModeAdapter;
 	private CacheModeType cacheMode;
+	TextRange cacheModeTextRange;
 
 	private DeclarationAnnotationElementAdapter<Boolean> cacheableDeclarationAdapter;
 	private AnnotationElementAdapter<Boolean> cacheableAdapter;
@@ -129,7 +125,9 @@
 		this.query = this.buildQuery(astRoot);
 		this.queryTextRange = this.buildQueryTextRange(astRoot);
 		this.flushMode = this.buildFlushMode(astRoot);
+		this.flushModeTextRange =  this.buildFlushModeTextRange(astRoot);
 		this.cacheMode = this.buildCacheMode(astRoot);
+		this.cacheModeTextRange = this.buildCacheModeTextRange(astRoot);
 		this.cacheable = this.buildCacheable(astRoot);
 		this.cacheRegion = this.buildCacheRegion(astRoot);
 		this.fetchSize = this.buildFetchSize(astRoot);
@@ -145,7 +143,9 @@
 		this.syncQuery(this.buildQuery(astRoot));
 		this.queryTextRange = this.buildQueryTextRange(astRoot);
 		this.syncFlushMode(this.buildFlushMode(astRoot));
+		this.flushModeTextRange =  this.buildFlushModeTextRange(astRoot);
 		this.syncCacheMode(this.buildCacheMode(astRoot));
+		this.cacheModeTextRange = this.buildCacheModeTextRange(astRoot);
 		this.syncCacheable(this.buildCacheable(astRoot));
 		this.syncCacheRegion(this.buildCacheRegion(astRoot));
 		this.syncFetchSize(this.buildFetchSize(astRoot));
@@ -188,7 +188,7 @@
 	}
 	
 	@Override
-	public TextRange getNameTextRange(CompilationUnit astRoot) {
+	public TextRange getNameTextRange() {
 		return this.nameTextRange;
 	}
 
@@ -221,7 +221,7 @@
 	}
 
 	@Override
-	public TextRange getQueryTextRange(CompilationUnit astRoot) {
+	public TextRange getQueryTextRange() {
 		return this.queryTextRange;
 	}
 	
@@ -231,44 +231,34 @@
 
 	// ***** hints
 	@Override
-	public ListIterator<QueryHintAnnotation> hints() {
-		return EmptyListIterator.instance();
+	public ListIterable<QueryHintAnnotation> getHints() {
+		return EmptyListIterable.instance();
 	}
 
-	ListIterator<NestableQueryHintAnnotation> nestableHints() {
-		return EmptyListIterator.instance();
-	}
-
 	@Override
-	public int hintsSize() {
+	public int getHintsSize() {
 		return 0;
 	}
 
 	@Override
-	public NestableQueryHintAnnotation hintAt(int index) {
-		throw new UnsupportedOperationException();
+	public QueryHintAnnotation hintAt(int index) {
+		return null;
 	}
 
 	@Override
-	public int indexOfHint(QueryHintAnnotation queryHint) {
-		return -1;
-	}
-
-	@Override
-	public NestableQueryHintAnnotation addHint(int index) {
+	public QueryHintAnnotation addHint(int index) {
 		return null;
 	}
 
 	@Override
 	public void moveHint(int targetIndex, int sourceIndex) {
-		//AnnotationContainerTools.moveNestedAnnotation(targetIndex, sourceIndex, this.hintsContainer);
+		//nothing to do
 	}
 
 	@Override
 	public void removeHint(int index) {
-		//AnnotationContainerTools.removeNestedAnnotation(index, this.hintsContainer);
+		//nothing to do
 	}
-
 	// ******************** HibernateNamedQueryAnnotation implementation *************
 	// ***** flushMode
 
@@ -290,15 +280,19 @@
 		this.flushMode = flushMode;
 		this.firePropertyChanged(FLUSH_MODE_PROPERTY, old, flushMode);
 	}
-
+	
 	private FlushModeType buildFlushMode(CompilationUnit astRoot) {
 		return FlushModeType.fromJavaAnnotationValue(this.flushModeAdapter.getValue(astRoot));
 	}
 
-	@Override
-	public TextRange getFlushModeTextRange(CompilationUnit astRoot) {
+	protected TextRange buildFlushModeTextRange(CompilationUnit astRoot) {
 		return this.getElementTextRange(this.flushModeDeclarationAdapter, astRoot);
 	}
+	
+	@Override
+	public TextRange getFlushModeTextRange() {
+		return this.flushModeTextRange;
+	}
 
 	// ***** caheMode
 
@@ -325,9 +319,13 @@
 		return CacheModeType.fromJavaAnnotationValue(this.cacheModeAdapter.getValue(astRoot));
 	}
 
+	protected TextRange buildCacheModeTextRange(CompilationUnit astRoot) {
+		return this.getElementTextRange(this.flushModeDeclarationAdapter, astRoot);
+	}
+	
 	@Override
-	public TextRange getCacheModeTextRange(CompilationUnit astRoot) {
-		return this.getElementTextRange(this.cacheModeDeclarationAdapter, astRoot);
+	public TextRange getCacheModeTextRange() {
+		return this.cacheModeTextRange;
 	}
 
 	//************************ cacheable *********************************
@@ -470,49 +468,6 @@
 	}
 	// ********** NestableAnnotation implementation **********
 	@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;
-
-		map.put(FLUSH_MODE_PROPERTY, this.flushMode);
-		this.flushMode = null;
-		map.put(CACHE_MODE_PROPERTY, this.cacheMode);
-		this.cacheMode = null;
-		map.put(CACHEABLE_PROPERTY, this.cacheable);
-		this.cacheable = null;
-		map.put(CACHE_REGION_PROPERTY, this.cacheRegion);
-		this.cacheRegion = null;
-		map.put(FETCH_SIZE_PROPERTY, this.fetchSize);
-		this.fetchSize = null;
-		map.put(TIMEOUT_PROPERTY, this.timeout);
-		this.timeout = null;
-		map.put(COMMENT_PROPERTY, this.comment);
-		this.comment = null;
-		map.put(READ_ONLY_PROPERTY, this.readOnly);
-		this.readOnly = null;
-	}
-
-	@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));
-		this.setFlushMode((FlushModeType) map.get(FLUSH_MODE_PROPERTY));
-		this.setCacheMode((CacheModeType) map.get(CACHE_MODE_PROPERTY));
-		this.setCacheable((Boolean) map.get(CACHEABLE_PROPERTY));
-		this.setCacheRegion((String) map.get(CACHE_REGION_PROPERTY));
-		this.setFetchSize((Integer) map.get(FETCH_SIZE_PROPERTY));
-		this.setTimeout((Integer) map.get(TIMEOUT_PROPERTY));
-		this.setComment((String)map.get(COMMENT_PROPERTY));
-		this.setReadOnly((Boolean) map.get(READ_ONLY_PROPERTY));
-	}
-
-	@Override
 	public boolean isUnset() {
 		return super.isUnset() &&
 				(this.name == null) &&
@@ -526,30 +481,6 @@
 				(this.readOnly == null);
 	}
 
-	@Override
-	protected void rebuildAdapters() {
-		super.rebuildAdapters();
-		this.nameDeclarationAdapter = this.buildNameAdapter(daa);
-		this.nameAdapter = this.buildAdapter(this.nameDeclarationAdapter);
-		this.queryDeclarationAdapter = this.buildQueryAdapter(daa);
-		this.queryAdapter = this.buildAdapter(this.queryDeclarationAdapter);
-		this.flushModeDeclarationAdapter = this.buildFlushModeAdapter(daa);
-		this.flushModeAdapter = new ShortCircuitAnnotationElementAdapter<String>(this.annotatedElement, this.flushModeDeclarationAdapter);
-		this.cacheModeDeclarationAdapter = this.buildCacheModeAdapter(daa);
-		this.cacheModeAdapter = new ShortCircuitAnnotationElementAdapter<String>(this.annotatedElement, this.cacheModeDeclarationAdapter);
-		this.cacheableDeclarationAdapter = this.buildCacheableAdapter(daa);
-		this.cacheableAdapter = new ShortCircuitAnnotationElementAdapter<Boolean>(this.annotatedElement, this.cacheableDeclarationAdapter);
-		this.cacheRegionDeclarationAdapter = this.buildCacheRegionAdapter(daa);
-		this.cacheRegionAdapter = this.buildAdapter(this.cacheRegionDeclarationAdapter);
-		this.fetchSizeDeclarationAdapter = this.buildFetchSizeAdapter(daa);
-		this.fetchSizeAdapter = new ShortCircuitAnnotationElementAdapter<Integer>(this.annotatedElement, this.fetchSizeDeclarationAdapter);
-		this.timeoutDeclarationAdapter = this.buildTimeoutAdapter(daa);
-		this.timeoutAdapter = new ShortCircuitAnnotationElementAdapter<Integer>(this.annotatedElement, this.timeoutDeclarationAdapter);
-		this.commentDeclarationAdapter = this.buildCommentAdapter(daa);
-		this.commentAdapter = new ShortCircuitAnnotationElementAdapter<String>(this.annotatedElement, this.commentDeclarationAdapter);
-		this.readOnlyDeclarationAdapter = this.buildReadOnlyAdapter(daa);
-		this.readOnlyAdapter = new ShortCircuitAnnotationElementAdapter<Boolean>(this.annotatedElement, this.readOnlyDeclarationAdapter);
-	}
 
 	/**
 	 * convenience implementation of method from NestableAnnotation interface
@@ -560,13 +491,18 @@
 		this.getIndexedAnnotationAdapter().moveAnnotation(newIndex);
 	}
 
-	@Override
-	public IndexedAnnotationAdapter getIndexedAnnotationAdapter() {
+	private IndexedAnnotationAdapter getIndexedAnnotationAdapter() {
 		return (IndexedAnnotationAdapter) this.annotationAdapter;
 	}
 
-	public static HibernateNamedQueryAnnotation createNamedQuery(JavaResourceNode parent, AnnotatedElement member) {
-		return new HibernateSourceNamedQueryAnnotation(parent, member, DECLARATION_ANNOTATION_ADAPTER, new ElementAnnotationAdapter(member, DECLARATION_ANNOTATION_ADAPTER));
+	public static HibernateNamedQueryAnnotation createNamedQuery(JavaResourceNode parent, AnnotatedElement annotatedElement, int index) {
+		IndexedDeclarationAnnotationAdapter idaa = buildNamedQueryDeclarationAnnotationAdapter(index);
+		IndexedAnnotationAdapter iaa = buildNamedQueryAnnotationAdapter(annotatedElement, idaa);
+		return new HibernateSourceNamedQueryAnnotation(
+			parent,
+			annotatedElement,
+			idaa,
+			iaa);
 	}
 
 	protected DeclarationAnnotationElementAdapter<String> buildNameAdapter(DeclarationAnnotationAdapter daAdapter) {
@@ -613,38 +549,20 @@
 	public void toString(StringBuilder sb) {
 		sb.append(this.name);
 	}
-	
-	/*
-	 * This is a workaround fix for https://bugs.eclipse.org/bugs/show_bug.cgi?id=357224
-	 * The exception occurs due to wrong cast in SourceAnnotation
-	 * The method should be removed after the bug fix.
-	 */
-	public void convertToStandAlone() {
-		Map<String, Object> map = new HashMap<String, Object>();
-		this.storeOn(map);
-		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();
-		((JavaResourceAnnotatedElement)this.parent).addStandAloneAnnotation((NestableAnnotation) this);
-		this.newAnnotation();
-		this.restoreFrom(map);
-	}
 
 	// ********** static methods **********
-
-	public static HibernateSourceNamedQueryAnnotation createHibernateNamedQuery(JavaResourceNode parent, AnnotatedElement member) {
-		return new HibernateSourceNamedQueryAnnotation(parent, member, DECLARATION_ANNOTATION_ADAPTER, new ElementAnnotationAdapter(member, DECLARATION_ANNOTATION_ADAPTER));
+	protected static IndexedAnnotationAdapter buildNamedQueryAnnotationAdapter(AnnotatedElement annotatedElement, IndexedDeclarationAnnotationAdapter idaa) {
+		return new ElementIndexedAnnotationAdapter(annotatedElement, idaa);
 	}
 
-	public static HibernateSourceNamedQueryAnnotation createNestedHibernateNamedQuery(JavaResourceNode parent, AnnotatedElement member, int index, DeclarationAnnotationAdapter attributeOverridesAdapter) {
-		IndexedDeclarationAnnotationAdapter idaa = buildNestedHibernateDeclarationAnnotationAdapter(index, attributeOverridesAdapter);
-		IndexedAnnotationAdapter annotationAdapter = new ElementIndexedAnnotationAdapter(member, idaa);
-		return new HibernateSourceNamedQueryAnnotation(parent, member, idaa, annotationAdapter);
+	private static IndexedDeclarationAnnotationAdapter buildNamedQueryDeclarationAnnotationAdapter(int index) {
+		IndexedDeclarationAnnotationAdapter idaa = 
+			new CombinationIndexedDeclarationAnnotationAdapter(
+				DECLARATION_ANNOTATION_ADAPTER,
+				CONTAINER_DECLARATION_ANNOTATION_ADAPTER,
+				index,
+				ANNOTATION_NAME);
+		return idaa;
 	}
 
-	private static IndexedDeclarationAnnotationAdapter buildNestedHibernateDeclarationAnnotationAdapter(int index, DeclarationAnnotationAdapter hibernateNamedQueriesAdapter) {
-		return new NestedIndexedDeclarationAnnotationAdapter(hibernateNamedQueriesAdapter, index, Hibernate.NAMED_QUERY);
-	}
-
 }

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/IndexAnnotation.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/IndexAnnotation.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/IndexAnnotation.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -12,8 +12,8 @@
 package org.jboss.tools.hibernate.jpt.core.internal.resource.java;
 
 import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jpt.common.core.resource.java.Annotation;
 import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.java.Annotation;
 import org.jboss.tools.hibernate.jpt.core.internal.context.basic.Hibernate;
 
 /**

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/IndexAnnotationImpl.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/IndexAnnotationImpl.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/IndexAnnotationImpl.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -13,29 +13,29 @@
 
 import org.eclipse.jdt.core.IAnnotation;
 import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
 import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
 import org.eclipse.jpt.common.core.internal.utility.jdt.ShortCircuitAnnotationElementAdapter;
 import org.eclipse.jpt.common.core.internal.utility.jdt.ShortCircuitArrayAnnotationElementAdapter;
 import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
 import org.eclipse.jpt.common.core.internal.utility.jdt.StringArrayExpressionConverter;
 import org.eclipse.jpt.common.core.internal.utility.jdt.StringExpressionConverter;
+import org.eclipse.jpt.common.core.resource.java.Annotation;
+import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
+import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
+import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
 import org.eclipse.jpt.common.core.utility.TextRange;
 import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
 import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
 import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
 import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
 import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.jpa.core.internal.resource.java.source.SourceAnnotation;
-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.JavaResourceNode;
 
 /**
  * @author Dmitry Geraskov
  *
  */
-public class IndexAnnotationImpl extends SourceAnnotation<Member>
+public class IndexAnnotationImpl extends SourceAnnotation
 implements IndexAnnotation{
 
 	public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);

Deleted: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/NestableParameterAnnotation.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/NestableParameterAnnotation.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/NestableParameterAnnotation.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -1,24 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 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.jboss.tools.hibernate.jpt.core.internal.resource.java;
-
-import org.eclipse.jpt.jpa.core.resource.java.NestableAnnotation;
-
-/**
- * @author Dmitry Geraskov
- *
- */
-public interface NestableParameterAnnotation extends 
-	ParameterAnnotation, NestableAnnotation {
-
-	// combine two interfaces
-	
-}

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/ParameterAnnotation.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/ParameterAnnotation.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/ParameterAnnotation.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -11,8 +11,8 @@
 package org.jboss.tools.hibernate.jpt.core.internal.resource.java;
 
 import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
 import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.java.Annotation;
 import org.jboss.tools.hibernate.jpt.core.internal.context.basic.Hibernate;
 
 /**
@@ -20,7 +20,7 @@
  * org.hibernate.annotations.Parameter
  */
 
-public interface ParameterAnnotation extends Annotation {
+public interface ParameterAnnotation extends NestableAnnotation {
 	String ANNOTATION_NAME = Hibernate.PARAMETER;
 
 	/**

Deleted: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/SourceGenericGeneratorsAnnotation.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/SourceGenericGeneratorsAnnotation.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/SourceGenericGeneratorsAnnotation.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -1,173 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008-2009 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.jboss.tools.hibernate.jpt.core.internal.resource.java;
-
-import java.util.Vector;
-
-import org.eclipse.jdt.core.IAnnotation;
-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.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneIterable;
-import org.eclipse.jpt.jpa.core.internal.resource.java.source.AnnotationContainerTools;
-import org.eclipse.jpt.jpa.core.internal.resource.java.source.SourceAnnotation;
-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.JavaResourceNode;
-import org.eclipse.jpt.jpa.core.resource.java.NestableAnnotation;
-import org.jboss.tools.hibernate.jpt.core.internal.context.basic.Hibernate;
-
-/**
- * @author Dmitry Geraskov
- *
- */
-public class SourceGenericGeneratorsAnnotation extends SourceAnnotation<AnnotatedElement> implements
-		GenericGeneratorsAnnotation {
-
-	public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
-	private final Vector<GenericGeneratorAnnotation> genericGenerators = new Vector<GenericGeneratorAnnotation>();
-
-
-	public SourceGenericGeneratorsAnnotation(JavaResourceNode parent, AnnotatedElement element) {
-		super(parent, element, 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.genericGenerators.isEmpty();
-	}
-
-	@Override
-	public void toString(StringBuilder sb) {
-		sb.append(this.genericGenerators);
-	}
-
-	// ********** AnnotationContainer implementation **********
-	public String getElementName() {
-		return Hibernate.GENERIC_GENERATORS__VALUE;
-	}
-
-	public String getNestedAnnotationName() {
-		return GenericGeneratorAnnotation.ANNOTATION_NAME;
-	}
-
-	public Iterable<GenericGeneratorAnnotation> getNestedAnnotations() {
-		return new LiveCloneIterable<GenericGeneratorAnnotation>(this.genericGenerators);
-	}
-
-	public int getNestedAnnotationsSize() {
-		return this.genericGenerators.size();
-	}
-
-	public void nestStandAloneAnnotation(NestableAnnotation standAloneAnnotation) {
-		this.nestStandAloneAnnotation(standAloneAnnotation, this.genericGenerators.size());
-	}
-
-	private void nestStandAloneAnnotation(NestableAnnotation standAloneAnnotation, int index) {
-		standAloneAnnotation.convertToNested(this, this.daa, index);
-	}
-
-	public void addNestedAnnotation(int index, NestableAnnotation annotation) {
-		this.genericGenerators.add(index, (GenericGeneratorAnnotation) annotation);
-	}
-
-	public void convertLastNestedAnnotationToStandAlone() {
-		this.genericGenerators.remove(0).convertToStandAlone();
-	}
-
-	public GenericGeneratorAnnotation addNestedAnnotation() {
-		return this.addNestedAnnotation(this.genericGenerators.size());
-	}
-
-	private GenericGeneratorAnnotation addNestedAnnotation(int index) {
-		GenericGeneratorAnnotation genericGenerator = this.buildGenericGenerator(index);
-		this.genericGenerators.add(genericGenerator);
-		return genericGenerator;
-	}
-
-	public void syncAddNestedAnnotation(org.eclipse.jdt.core.dom.Annotation astAnnotation) {
-		int index = this.genericGenerators.size();
-		GenericGeneratorAnnotation genericGenerator = this.addNestedAnnotation(index);
-		genericGenerator.initialize((CompilationUnit) astAnnotation.getRoot());
-		this.fireItemAdded(GENERIC_GENERATORS_LIST, index, genericGenerator);
-	}
-
-	private GenericGeneratorAnnotation buildGenericGenerator(int index) {
-		return GenericGeneratorAnnotationImpl.createNestedGenericGenerator(this.parent, this.annotatedElement, index, this.daa);
-	}
-
-	public GenericGeneratorAnnotation moveNestedAnnotation(int targetIndex, int sourceIndex) {
-		return CollectionTools.move(this.genericGenerators, targetIndex, sourceIndex).get(targetIndex);
-	}
-
-	public GenericGeneratorAnnotation removeNestedAnnotation(int index) {
-		return this.genericGenerators.remove(index);
-	}
-
-	public void syncRemoveNestedAnnotations(int index) {
-		this.removeItemsFromList(index, this.genericGenerators, GENERIC_GENERATORS_LIST);
-	}
-
-	public static class GenericGeneratorsAnnotationDefinition implements AnnotationDefinition {
-
-		// singleton
-		private static final AnnotationDefinition INSTANCE = new GenericGeneratorsAnnotationDefinition();
-
-		/**
-		 * Return the singleton.
-		 */
-		public static AnnotationDefinition instance() {
-			return INSTANCE;
-		}
-
-		/**
-		 * Ensure single instance.
-		 */
-		private GenericGeneratorsAnnotationDefinition() {
-			super();
-		}
-
-		public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
-			return new SourceGenericGeneratorsAnnotation(parent, annotatedElement);
-		}
-
-		public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
-			throw new UnsupportedOperationException();
-		}
-
-		public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
-			throw new UnsupportedOperationException();
-		}
-
-		public String getAnnotationName() {
-			return GenericGeneratorsAnnotation.ANNOTATION_NAME;
-		}
-
-	}
-
-}

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/SourceParameterAnnotation.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/SourceParameterAnnotation.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/SourceParameterAnnotation.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -10,33 +10,27 @@
  ******************************************************************************/
 package org.jboss.tools.hibernate.jpt.core.internal.resource.java;
 
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
 import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
 import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
 import org.eclipse.jpt.common.core.internal.utility.jdt.ElementIndexedAnnotationAdapter;
 import org.eclipse.jpt.common.core.internal.utility.jdt.NestedIndexedDeclarationAnnotationAdapter;
 import org.eclipse.jpt.common.core.internal.utility.jdt.ShortCircuitAnnotationElementAdapter;
+import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
 import org.eclipse.jpt.common.core.utility.TextRange;
 import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
 import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
 import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
 import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedAnnotationAdapter;
 import org.eclipse.jpt.common.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.jpa.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.jpa.core.resource.java.NestableAnnotation;
 import org.jboss.tools.hibernate.jpt.core.internal.context.basic.Hibernate;
 
 /**
  * @author Dmitry Geraskov
  *
  */
-public class SourceParameterAnnotation extends SourceAnnotation<AnnotatedElement> implements
-		NestableParameterAnnotation {
+public class SourceParameterAnnotation extends SourceAnnotation implements
+	ParameterAnnotation {
 
 	private final DeclarationAnnotationElementAdapter<String> nameDeclarationAdapter;
 	private final AnnotationElementAdapter<String> nameAdapter;
@@ -82,11 +76,6 @@
 	}
 
 	@Override
-	public IndexedAnnotationAdapter getIndexedAnnotationAdapter() {
-		return (IndexedAnnotationAdapter) this.annotationAdapter;
-	}
-
-	@Override
 	public void toString(StringBuilder sb) {
 		sb.append(this.name);
 	}
@@ -146,28 +135,6 @@
 		return this.getElementTextRange(this.valueDeclarationAdapter, astRoot);
 	}
 
-
-	// ********** NestableAnnotation implementation **********
-	public void moveAnnotation(int newIndex) {
-		this.getIndexedAnnotationAdapter().moveAnnotation(newIndex);
-	}
-	
-	@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));
-	}
-
 	// ********** static methods **********
 
 	public static SourceParameterAnnotation createParameter(JavaResourceNode parent, AnnotatedElement member,  DeclarationAnnotationAdapter annotationAdapter, String elementName, int index) {

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/TypeAnnotation.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/TypeAnnotation.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/TypeAnnotation.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -11,8 +11,8 @@
 package org.jboss.tools.hibernate.jpt.core.internal.resource.java;
 
 import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jpt.common.core.resource.java.Annotation;
 import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.java.Annotation;
 import org.jboss.tools.hibernate.jpt.core.internal.context.basic.Hibernate;
 
 /**

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/TypeAnnotationImpl.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/TypeAnnotationImpl.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/TypeAnnotationImpl.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -12,26 +12,26 @@
 
 import org.eclipse.jdt.core.IAnnotation;
 import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
 import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
 import org.eclipse.jpt.common.core.internal.utility.jdt.ShortCircuitAnnotationElementAdapter;
 import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
+import org.eclipse.jpt.common.core.resource.java.Annotation;
+import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
+import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
+import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
 import org.eclipse.jpt.common.core.utility.TextRange;
 import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
 import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
 import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
 import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
 import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.jpa.core.internal.resource.java.source.SourceAnnotation;
-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.JavaResourceNode;
 
 /**
  * @author Dmitry Geraskov
  *
  */
-public class TypeAnnotationImpl extends SourceAnnotation<Member> implements
+public class TypeAnnotationImpl extends SourceAnnotation implements
 TypeAnnotation {
 
 	public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/TypeDefAnnotation.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/TypeDefAnnotation.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/TypeDefAnnotation.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -10,11 +10,10 @@
   ******************************************************************************/
 package org.jboss.tools.hibernate.jpt.core.internal.resource.java;
 
-import java.util.ListIterator;
-
 import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
 import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.java.NestableAnnotation;
+import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
 import org.jboss.tools.hibernate.jpt.core.internal.context.basic.Hibernate;
 
 /**
@@ -116,41 +115,34 @@
 	String getFullyQualifiedTypeClassName();
 		String FULLY_QUALIFIED_TYPE_CLASS_NAME_PROPERTY = "fullyQualifiedTypeClassName"; //$NON-NLS-1$
 
-	
-	/**
-	 * Return an empty iterator if the element does not exist in Java.
-	 */
-	ListIterator<ParameterAnnotation> parameters();
-		String PARAMETERS_LIST = "parameters"; //$NON-NLS-1$
-	
-	/**
-	 * Corresponds to the 'parameters' element of the *TypeDef annotation.
-	 */
-	int parametersSize();
+		/**
+		 * Return an empty iterator if the element does not exist in Java.
+		 */
+		ListIterable<ParameterAnnotation> getParameters();
+			String PARAMETERS_LIST = "parameters"; //$NON-NLS-1$
+		
+		/**
+		 * Corresponds to the 'parameters' element of the *Generic Generator annotation.
+		 */
+		int getParametersSize();
 
-	/**
-	 * Corresponds to the 'parameters' element of the *TypeDef annotation.
-	 */
-	ParameterAnnotation parameterAt(int index);
-	
-	/**
-	 * Corresponds to the 'parameters' element of the *TypeDef annotation.
-	 */
-	int indexOfParameter(ParameterAnnotation parameter);
-	
-	/**
-	 * Corresponds to the 'parameters' element of the *TypeDef annotation.
-	 */
-	ParameterAnnotation addParameter(int index);
-	
-	/**
-	 * Corresponds to the 'parameters' element of the *TypeDef annotation.
-	 */
-	void moveParameter(int targetIndex, int sourceIndex);
+		/**
+		 * Corresponds to the 'parameters' element of the *Generic Generator annotation.
+		 */
+		ParameterAnnotation parameterAt(int index);
+		
+		/**
+		 * Corresponds to the 'parameters' element of the *Generic Generator annotation.
+		 */
+		ParameterAnnotation addParameter(int index);
+		
+		/**
+		 * Corresponds to the 'parameters' element of the *Generic Generator annotation.
+		 */
+		void moveParameter(int targetIndex, int sourceIndex);
 
-	/**
-	 * Corresponds to the 'parameters' element of the *TypeDef annotation.
-	 */
-	void removeParameter(int index);	
-
+		/**
+		 * Corresponds to the 'parameters' element of the *Generic Generator annotation.
+		 */
+		void removeParameter(int index);
 }

Added: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/TypeDefAnnotationDefinition.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/TypeDefAnnotationDefinition.java	                        (rev 0)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/TypeDefAnnotationDefinition.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -0,0 +1,73 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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.jboss.tools.hibernate.jpt.core.internal.resource.java;
+
+import org.eclipse.jdt.core.IAnnotation;
+import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
+import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
+import org.eclipse.jpt.common.core.resource.java.NestableAnnotationDefinition;
+import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
+import org.jboss.tools.hibernate.jpt.core.internal.context.basic.Hibernate;
+
+/**
+ * @author Dmitry Geraskov
+ *
+ */
+public class TypeDefAnnotationDefinition implements NestableAnnotationDefinition
+{
+	// singleton
+	private static final NestableAnnotationDefinition INSTANCE = new TypeDefAnnotationDefinition();
+
+	/**
+	 * Return the singleton.
+	 */
+	public static NestableAnnotationDefinition instance() {
+		return INSTANCE;
+	}
+
+	/**
+	 * Ensure non-instantiability.
+	 */
+	private TypeDefAnnotationDefinition() {
+		super();
+	}
+
+
+	@Override
+	public String getNestableAnnotationName() {
+		return Hibernate.TYPE_DEF;
+	}
+
+	@Override
+	public String getContainerAnnotationName() {
+		return Hibernate.TYPE_DEFS;
+	}
+
+	@Override
+	public String getElementName() {
+		return Hibernate.TYPE_DEFS__VALUE;
+	}
+
+	@Override
+	public NestableAnnotation buildAnnotation(JavaResourceAnnotatedElement parent,	AnnotatedElement annotatedElement, int index) {
+		return TypeDefAnnotationImpl.buildTypeDefAnnotationAnnotation(parent, annotatedElement, index);
+	}
+
+	@Override
+	public NestableAnnotation buildAnnotation(
+			JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation,
+			int index) {
+		throw new UnsupportedOperationException();
+	}
+
+	
+}
+

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/TypeDefAnnotationImpl.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/TypeDefAnnotationImpl.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/TypeDefAnnotationImpl.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -10,22 +10,20 @@
   ******************************************************************************/
 package org.jboss.tools.hibernate.jpt.core.internal.resource.java;
 
-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.IAnnotation;
 import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
 import org.eclipse.jpt.common.core.internal.utility.jdt.ASTTools;
+import org.eclipse.jpt.common.core.internal.utility.jdt.CombinationIndexedDeclarationAnnotationAdapter;
 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.internal.utility.jdt.SimpleTypeStringExpressionConverter;
 import org.eclipse.jpt.common.core.internal.utility.jdt.TypeStringExpressionConverter;
+import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
+import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
+import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
 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;
@@ -34,28 +32,20 @@
 import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
 import org.eclipse.jpt.common.core.utility.jdt.IndexedAnnotationAdapter;
 import org.eclipse.jpt.common.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterators.CloneListIterator;
-import org.eclipse.jpt.jpa.core.internal.resource.java.source.AnnotationContainerTools;
-import org.eclipse.jpt.jpa.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.AnnotationContainer;
-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.JavaResourceNode;
-import org.eclipse.jpt.jpa.core.resource.java.NestableAnnotation;
+import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
 import org.jboss.tools.hibernate.jpt.core.internal.context.basic.Hibernate;
 
 /**
  * @author Dmitry Geraskov
  *
  */
-public class TypeDefAnnotationImpl extends SourceAnnotation<AnnotatedElement>
+public class TypeDefAnnotationImpl extends SourceAnnotation
 					implements TypeDefAnnotation {
 
 	private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
+	private static final DeclarationAnnotationAdapter CONTAINER_DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(Hibernate.TYPE_DEFS);
 
+	
 	private DeclarationAnnotationElementAdapter<String> nameDeclarationAdapter;
 	private AnnotationElementAdapter<String> nameAdapter;
 	private String name;
@@ -72,7 +62,7 @@
 
 	String fullyQualifiedDefaultForTypeClassName;
 
-	final Vector<NestableParameterAnnotation> parameters = new Vector<NestableParameterAnnotation>();
+	final Vector<ParameterAnnotation> parameters = new Vector<ParameterAnnotation>();
 	final ParametersAnnotationContainer parametersContainer = new ParametersAnnotationContainer();
 
 	/**
@@ -96,7 +86,7 @@
 		this.fullyQualifiedTypeClassName = this.buildFullyQualifiedTypeClassName(astRoot);
 		this.defaultForType = this.buildDefaultForType(astRoot);
 		this.fullyQualifiedDefaultForTypeClassName = this.buildFullyQualifiedDefaultForTypeClassName(astRoot);
-		AnnotationContainerTools.initialize(this.parametersContainer, astRoot);
+		this.parametersContainer.initializeFromContainerAnnotation(this.getAstAnnotation(astRoot));
 	}
 
 	public void synchronizeWith(CompilationUnit astRoot) {
@@ -105,53 +95,9 @@
 		this.syncFullyQualifiedTypeClassName(this.buildFullyQualifiedTypeClassName(astRoot));
 		this.syncDefaultForType(this.buildDefaultForType(astRoot));
 		this.syncFullyQualifiedDefaultForTypeClassName(this.buildFullyQualifiedDefaultForTypeClassName(astRoot));
-		AnnotationContainerTools.synchronize(this.parametersContainer, astRoot);
+		this.parametersContainer.synchronize(this.getAstAnnotation(astRoot));
 	}
 	
-	// ********** misc **********
-	@Override
-	protected void rebuildAdapters() {
-		super.rebuildAdapters();
-		this.nameDeclarationAdapter = this.buildNameDeclarationAdapter();
-		this.nameAdapter = this.buildNameAdapter();
-		this.typeClassDeclarationAdapter = this.buildTypeClassDeclarationAdapter();
-		this.typeClassAdapter = this.buildTypeClassAdapter();
-		this.defForTypeDeclarationAdapter = this.buildDefForTypeDeclarationAdapter();
-		this.defaultForTypeAdapter = this.buildDefForTypeAdapter();
-	}
-	
-	@Override
-	public void storeOn(Map<String, Object> map) {
-		super.storeOn(map);
-		map.put(NAME_PROPERTY, this.name);
-		this.name = null;
-		map.put(TYPE_CLASS_PROPERTY, this.typeClass);
-		this.typeClass = null;
-		map.put(DEF_FOR_TYPE_PROPERTY, this.defaultForType);
-		this.defaultForType = null;
-		List<Map<String, Object>> paramStaet = this.buildStateList(this.parameters.size());
-		for (NestableParameterAnnotation param : nestableParameters()) {
-			Map<String, Object> hintState = new HashMap<String, Object>();
-			param.storeOn(hintState);
-			paramStaet.add(hintState);
-		}
-		map.put(PARAMETERS_LIST, paramStaet);
-		this.parameters.clear();
-	}
-
-	@Override
-	public void restoreFrom(Map<String, Object> map) {
-		super.restoreFrom(map);
-		this.setName((String) map.get(NAME_PROPERTY));
-		this.setTypeClass((String) map.get(TYPE_CLASS_PROPERTY));
-		this.setDefaultForType((String) map.get(DEF_FOR_TYPE_PROPERTY));
-		@SuppressWarnings("unchecked")
-		List<Map<String, Object>> paramsState = (List<Map<String, Object>>) map.get(PARAMETERS_LIST);
-		for (Map<String, Object> paramState : paramsState) {
-			this.addParameter().restoreFrom(paramState);
-		}
-	}
-
 	// ********** TypeDefAnnotation implementation **********
 
 	// ***** name
@@ -267,94 +213,41 @@
 		return (this.defaultForType == null) ? null : ASTTools.resolveFullyQualifiedName(this.defaultForTypeAdapter.getExpression(astRoot));
 	}
 	//************************ parameters ***********************
-	private NestableParameterAnnotation addParameter() {
-		return this.addParameter(this.parameters.size());
+	@Override
+	public ListIterable<ParameterAnnotation> getParameters() {
+		return this.parametersContainer.getNestedAnnotations();
 	}
-	
-	public NestableParameterAnnotation addParameter(int index) {
-		return (NestableParameterAnnotation) AnnotationContainerTools.addNestedAnnotation(index, this.parametersContainer);
-	}
 
-	NestableParameterAnnotation addParameter_() {
-		NestableParameterAnnotation parameter = this.buildParameter(this.parameters.size());
-		this.parameters.add(parameter);
-		return parameter;
+	@Override
+	public int getParametersSize() {
+		return this.parametersContainer.getNestedAnnotationsSize();
 	}
 
-	NestableParameterAnnotation buildParameter(int index) {
-		return SourceParameterAnnotation.createParameter(this, this.annotatedElement, this.daa, Hibernate.TYPE_DEF__PARAMETERS, index);
+	@Override
+	public ParameterAnnotation parameterAt(int index) {
+		return this.parametersContainer.getNestedAnnotation(index);
 	}
 
-	Iterable<NestableParameterAnnotation> nestableParameters() {
-		return this.parameters;
+	@Override
+	public ParameterAnnotation addParameter(int index) {
+		return this.parametersContainer.addNestedAnnotation(index);
 	}
 
-	void syncAddParameterAnnotation(org.eclipse.jdt.core.dom.Annotation nestedAnnotation) {
-		NestableParameterAnnotation parameter = this.addParameter_();
-		parameter.initialize((CompilationUnit) nestedAnnotation.getRoot());
-		this.fireItemAdded(PARAMETERS_LIST, parametersSize() - 1, parameter);
-	}
-
-	NestableParameterAnnotation moveParameter_(int targetIndex, int sourceIndex) {
-		return CollectionTools.move(this.parameters, targetIndex, sourceIndex).get(targetIndex);
-	}
-
-	void parameterMoved(int targetIndex, int sourceIndex) {
-		this.fireItemMoved(PARAMETERS_LIST, targetIndex, sourceIndex);
-	}
-
-	public int indexOfParameter(ParameterAnnotation parameter) {
-		return this.parameters.indexOf(parameter);
-	}
-
+	@Override
 	public void moveParameter(int targetIndex, int sourceIndex) {
-		AnnotationContainerTools.moveNestedAnnotation(targetIndex, sourceIndex, this.parametersContainer);
+		this.parametersContainer.moveNestedAnnotation(targetIndex, sourceIndex);
 	}
-
-	public ParameterAnnotation parameterAt(int index) {
-		return this.parameters.get(index);
-	}
-
-	public ListIterator<ParameterAnnotation> parameters() {
-		return new CloneListIterator<ParameterAnnotation>(this.parameters);
-	}
-
-	public int parametersSize() {
-		return this.parameters.size();
-	}
-
+	
+	@Override
 	public void removeParameter(int index) {
-		AnnotationContainerTools.removeNestedAnnotation(index, this.parametersContainer);
+		this.parametersContainer.removeNestedAnnotation(index);
 	}
 
-	NestableParameterAnnotation removeParameter_(int index) {
-		return this.parameters.remove(index);
+	ParameterAnnotation buildParameter(int index) {
+		return SourceParameterAnnotation.createParameter(this, this.annotatedElement, this.daa, Hibernate.GENERIC_GENERATOR__PARAMETERS, index);
 	}
 
-	void parameterRemoved(int index) {
-		this.removeItemsFromList(index, this.parameters, PARAMETERS_LIST);
-	}
 
-	// ********** NestableAnnotation implementation **********
-	/**
-	 * convenience implementation of method from NestableAnnotation interface
-	 * for subclasses
-	 */
-	public void moveAnnotation(int newIndex) {
-		this.getIndexedAnnotationAdapter().moveAnnotation(newIndex);
-	}
-
-	@Override
-	public IndexedAnnotationAdapter getIndexedAnnotationAdapter() {
-		return (IndexedAnnotationAdapter) this.annotationAdapter;
-	}
-
-	@Override
-	public void toString(StringBuilder sb) {
-		super.toString(sb);
-		sb.append(this.name);
-	}
-
 	private DeclarationAnnotationElementAdapter<String> buildNameDeclarationAdapter() {
 		return ConversionDeclarationAnnotationElementAdapter.forStrings(daa, Hibernate.TYPE_DEF__NAME);
 	}
@@ -367,73 +260,27 @@
 	 * adapt the AnnotationContainer interface to the override's join columns
 	 */
 	class ParametersAnnotationContainer
-		implements AnnotationContainer<NestableParameterAnnotation>
+		extends AnnotationContainer<ParameterAnnotation>
 	{
-		public String getContainerAnnotationName() {
-			return TypeDefAnnotationImpl.this.getAnnotationName();
+		
+		@Override
+		protected String getNestedAnnotationsListName() {
+			return PARAMETERS_LIST;
 		}
-
-		public org.eclipse.jdt.core.dom.Annotation getAstAnnotation(CompilationUnit astRoot) {
-			return TypeDefAnnotationImpl.this.getAstAnnotation(astRoot);
-		}
-
-		public String getElementName() {
+		@Override
+		protected String getElementName() {
 			return Hibernate.TYPE_DEF__PARAMETERS;
 		}
-
-		public String getNestedAnnotationName() {
+		@Override
+		protected String getNestedAnnotationName() {
 			return ParameterAnnotation.ANNOTATION_NAME;
 		}
-
-		public Iterable<NestableParameterAnnotation> getNestedAnnotations() {
-			return TypeDefAnnotationImpl.this.nestableParameters();
-		}
-
-		public int getNestedAnnotationsSize() {
-			return TypeDefAnnotationImpl.this.parametersSize();
-		}
-
-		public NestableParameterAnnotation addNestedAnnotation() {
-			return TypeDefAnnotationImpl.this.addParameter_();
-		}
-
-		public void syncAddNestedAnnotation(org.eclipse.jdt.core.dom.Annotation nestedAnnotation) {
-			TypeDefAnnotationImpl.this.syncAddParameterAnnotation(nestedAnnotation);
-		}
-
-		public NestableParameterAnnotation moveNestedAnnotation(int targetIndex, int sourceIndex) {
-			return TypeDefAnnotationImpl.this.moveParameter_(targetIndex, sourceIndex);
-		}
-
-		public NestableParameterAnnotation removeNestedAnnotation(int index) {
-			return TypeDefAnnotationImpl.this.removeParameter_(index);
-		}
-
-		public void syncRemoveNestedAnnotations(int index) {
-			TypeDefAnnotationImpl.this.parameterRemoved(index);
-		}
-
 		@Override
-		public String toString() {
-			return StringTools.buildToStringFor(this);
+		protected ParameterAnnotation buildNestedAnnotation(int index) {
+			return TypeDefAnnotationImpl.this.buildParameter(index);
 		}
-
 	}
 
-	public static TypeDefAnnotation createNestedTypeDef(
-			JavaResourceNode parent, AnnotatedElement member,
-			int index, DeclarationAnnotationAdapter attributeOverridesAdapter) {
-		IndexedDeclarationAnnotationAdapter idaa = buildNestedHibernateDeclarationAnnotationAdapter(index, attributeOverridesAdapter);
-		IndexedAnnotationAdapter annotationAdapter = new ElementIndexedAnnotationAdapter(member, idaa);
-		return new TypeDefAnnotationImpl(parent, member, idaa, annotationAdapter);
-	}
-
-	private static IndexedDeclarationAnnotationAdapter buildNestedHibernateDeclarationAnnotationAdapter(int index, DeclarationAnnotationAdapter hibernateTypeDefsAdapter) {
-		return new NestedIndexedDeclarationAnnotationAdapter(hibernateTypeDefsAdapter, index, Hibernate.TYPE_DEF);
-	}
-
-
-
 	private DeclarationAnnotationElementAdapter<String> buildTypeClassDeclarationAdapter() {
 		return new ConversionDeclarationAnnotationElementAdapter<String>(daa,
 				Hibernate.TYPE_DEF__TYPE_CLASS,
@@ -453,61 +300,33 @@
 	private AnnotationElementAdapter<String> buildDefForTypeAdapter() {
 		return this.buildStringElementAdapter(this.defForTypeDeclarationAdapter);
 	}
-
-	/*
-	 * This is a workaround fix for https://bugs.eclipse.org/bugs/show_bug.cgi?id=357224
-	 * The exception occurs due to wrong cast in SourceAnnotation
-	 * The method should be removed after the bug fix.
-	 */
-	public void convertToStandAlone() {
-		Map<String, Object> map = new HashMap<String, Object>();
-		this.storeOn(map);
-		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();
-		((JavaResourceAnnotatedElement)this.parent).addStandAloneAnnotation((NestableAnnotation) this);
-		this.newAnnotation();
-		this.restoreFrom(map);
+	
+	public static NestableAnnotation buildTypeDefAnnotationAnnotation(
+			JavaResourceAnnotatedElement parent,
+			AnnotatedElement annotatedElement, int index) {
+		IndexedDeclarationAnnotationAdapter idaa = buildTypeDefDeclarationAnnotationAdapter(index);
+		IndexedAnnotationAdapter iaa = buildTypeDefAnnotationAdapter(annotatedElement, idaa);
+		return new GenericGeneratorAnnotationImpl(
+			parent,
+			annotatedElement,
+			idaa,
+			iaa);
 	}
-
-	public static class TypeDefAnnotationDefinition implements AnnotationDefinition
-	{
-		// singleton
-		private static final TypeDefAnnotationDefinition INSTANCE = new TypeDefAnnotationDefinition();
-
-		/**
-		 * Return the singleton.
-		 */
-		public static AnnotationDefinition instance() {
-			return INSTANCE;
-		}
-
-		/**
-		 * Ensure non-instantiability.
-		 */
-		private TypeDefAnnotationDefinition() {
-			super();
-		}
-
-		public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
-			return new TypeDefAnnotationImpl(parent, annotatedElement,
-				DECLARATION_ANNOTATION_ADAPTER, new ElementAnnotationAdapter(annotatedElement, DECLARATION_ANNOTATION_ADAPTER));
-		}
-
-		public String getAnnotationName() {
-			return TypeDefAnnotation.ANNOTATION_NAME;
-		}
-
-		public Annotation buildAnnotation(JavaResourceAnnotatedElement arg0,
-				IAnnotation arg1) {
-			throw new UnsupportedOperationException();
-		}
-
-		public Annotation buildNullAnnotation(JavaResourceAnnotatedElement arg0) {
-			throw new UnsupportedOperationException();
-		}
+	
+	protected static IndexedAnnotationAdapter buildTypeDefAnnotationAdapter(AnnotatedElement annotatedElement, IndexedDeclarationAnnotationAdapter idaa) {
+		return new ElementIndexedAnnotationAdapter(annotatedElement, idaa);
 	}
+	
+	private static IndexedDeclarationAnnotationAdapter buildTypeDefDeclarationAnnotationAdapter(int index) {
+		IndexedDeclarationAnnotationAdapter idaa =
+				new CombinationIndexedDeclarationAnnotationAdapter(
+						DECLARATION_ANNOTATION_ADAPTER,
+						CONTAINER_DECLARATION_ANNOTATION_ADAPTER,
+						index,
+						ANNOTATION_NAME);
+		return idaa;
+	}
 
 
+
 }

Deleted: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/TypeDefsAnnotation.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/TypeDefsAnnotation.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/TypeDefsAnnotation.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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.jboss.tools.hibernate.jpt.core.internal.resource.java;
-
-import org.eclipse.jpt.jpa.core.resource.java.ContainerAnnotation;
-import org.jboss.tools.hibernate.jpt.core.internal.context.basic.Hibernate;
-
-/**
- * @author Dmitry Geraskov
- *
- */
-public interface TypeDefsAnnotation extends
-		ContainerAnnotation<TypeDefAnnotation> {
-	
-	String ANNOTATION_NAME = Hibernate.TYPE_DEFS;
-
-	String TYPE_DEFS_LIST = "typeDefs"; //$NON-NLS-1$
-
-
-}

Added: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/TypeDefsAnnotationDefinition.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/TypeDefsAnnotationDefinition.java	                        (rev 0)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/TypeDefsAnnotationDefinition.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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.jboss.tools.hibernate.jpt.core.internal.resource.java;
+
+import org.eclipse.jdt.core.IAnnotation;
+import org.eclipse.jpt.common.core.internal.resource.java.source.SourceNamedAnnotation;
+import org.eclipse.jpt.common.core.resource.java.Annotation;
+import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
+import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
+import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
+import org.jboss.tools.hibernate.jpt.core.internal.context.basic.Hibernate;
+
+/**
+ * @author Dmitry Geraskov
+ *
+ */
+public class TypeDefsAnnotationDefinition implements AnnotationDefinition {
+
+	// singleton
+		private static final AnnotationDefinition INSTANCE = new TypeDefsAnnotationDefinition();
+
+		/**
+		 * Return the singleton.
+		 */
+		public static AnnotationDefinition instance() {
+			return INSTANCE;
+		}
+
+		/**
+		 * Ensure single instance.
+		 */
+		private TypeDefsAnnotationDefinition() {
+			super();
+		}
+
+		@Override
+		public String getAnnotationName() {
+			return Hibernate.TYPE_DEFS;
+		}
+
+		@Override
+		public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
+			return new SourceNamedAnnotation(parent, annotatedElement, getAnnotationName());
+		}
+
+		@Override
+		public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
+			throw new UnsupportedOperationException();
+		}
+
+		@Override
+		public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
+			throw new UnsupportedOperationException();
+		}
+
+
+}

Deleted: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/TypeDefsAnnotationImpl.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/TypeDefsAnnotationImpl.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/TypeDefsAnnotationImpl.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -1,173 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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.jboss.tools.hibernate.jpt.core.internal.resource.java;
-
-import java.util.Vector;
-
-import org.eclipse.jdt.core.IAnnotation;
-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.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneIterable;
-import org.eclipse.jpt.jpa.core.internal.resource.java.source.AnnotationContainerTools;
-import org.eclipse.jpt.jpa.core.internal.resource.java.source.SourceAnnotation;
-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.JavaResourceNode;
-import org.eclipse.jpt.jpa.core.resource.java.NestableAnnotation;
-import org.jboss.tools.hibernate.jpt.core.internal.context.basic.Hibernate;
-
-/**
- * @author Dmitry Geraskov
- *
- */
-public class TypeDefsAnnotationImpl extends SourceAnnotation<AnnotatedElement> implements
-		TypeDefsAnnotation {
-
-	public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
-	private final Vector<TypeDefAnnotation> typeDefs = new Vector<TypeDefAnnotation>();
-
-
-	public TypeDefsAnnotationImpl(JavaResourceNode parent, AnnotatedElement 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.typeDefs.isEmpty();
-	}
-
-	@Override
-	public void toString(StringBuilder sb) {
-		sb.append(this.typeDefs);
-	}
-
-	// ********** AnnotationContainer implementation **********
-	public String getElementName() {
-		return Hibernate.TYPE_DEFS__VALUE;
-	}
-
-	public String getNestedAnnotationName() {
-		return TypeDefAnnotation.ANNOTATION_NAME;
-	}
-
-	public Iterable<TypeDefAnnotation> getNestedAnnotations() {
-		return new LiveCloneIterable<TypeDefAnnotation>(this.typeDefs);
-	}
-
-	public int getNestedAnnotationsSize() {
-		return this.typeDefs.size();
-	}
-
-	public void nestStandAloneAnnotation(NestableAnnotation standAloneAnnotation) {
-		this.nestStandAloneAnnotation(standAloneAnnotation, this.typeDefs.size());
-	}
-
-	private void nestStandAloneAnnotation(NestableAnnotation standAloneAnnotation, int index) {
-		standAloneAnnotation.convertToNested(this, this.daa, index);
-	}
-
-	public void addNestedAnnotation(int index, NestableAnnotation annotation) {
-		this.typeDefs.add(index, (TypeDefAnnotation) annotation);
-	}
-
-	public void convertLastNestedAnnotationToStandAlone() {
-		this.typeDefs.remove(0).convertToStandAlone();
-	}
-
-	public TypeDefAnnotation addNestedAnnotation() {
-		return this.addNestedAnnotation(this.typeDefs.size());
-	}
-
-	private TypeDefAnnotation addNestedAnnotation(int index) {
-		TypeDefAnnotation typeDef = this.buildTypeDef(index);
-		this.typeDefs.add(typeDef);
-		return typeDef;
-	}
-
-	public void syncAddNestedAnnotation(org.eclipse.jdt.core.dom.Annotation astAnnotation) {
-		int index = this.typeDefs.size();
-		TypeDefAnnotation typeDef = this.addNestedAnnotation(index);
-		typeDef.initialize((CompilationUnit) astAnnotation.getRoot());
-		this.fireItemAdded(TYPE_DEFS_LIST, index, typeDef);
-	}
-
-	private TypeDefAnnotation buildTypeDef(int index) {
-		return TypeDefAnnotationImpl.createNestedTypeDef(this.parent, this.annotatedElement, index, this.daa);
-	}
-
-	public TypeDefAnnotation moveNestedAnnotation(int targetIndex, int sourceIndex) {
-		return CollectionTools.move(this.typeDefs, targetIndex, sourceIndex).get(targetIndex);
-	}
-
-	public TypeDefAnnotation removeNestedAnnotation(int index) {
-		return this.typeDefs.remove(index);
-	}
-
-	public void syncRemoveNestedAnnotations(int index) {
-		this.removeItemsFromList(index, this.typeDefs, TYPE_DEFS_LIST);
-	}
-
-	public static class TypeDefsAnnotationDefinition implements AnnotationDefinition {
-
-		// singleton
-		private static final AnnotationDefinition INSTANCE = new TypeDefsAnnotationDefinition();
-
-		/**
-		 * Return the singleton.
-		 */
-		public static AnnotationDefinition instance() {
-			return INSTANCE;
-		}
-
-		/**
-		 * Ensure single instance.
-		 */
-		private TypeDefsAnnotationDefinition() {
-			super();
-		}
-
-		public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement member) {
-			return new TypeDefsAnnotationImpl(parent, member);
-		}
-
-		public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
-			throw new UnsupportedOperationException();
-		}
-
-		public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
-			throw new UnsupportedOperationException();
-		}
-
-		public String getAnnotationName() {
-			return TypeDefsAnnotation.ANNOTATION_NAME;
-		}
-
-	}
-
-}

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/validation/HibernateJpaValidationMessage.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/validation/HibernateJpaValidationMessage.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/validation/HibernateJpaValidationMessage.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -10,9 +10,11 @@
  ******************************************************************************/
 package org.jboss.tools.hibernate.jpt.core.internal.validation;
 
+import org.eclipse.core.resources.IResource;
 import org.eclipse.jpt.common.core.utility.TextRange;
+import org.eclipse.jpt.jpa.core.JpaNode;
 import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.internal.validation.JpaValidationPreferences;
+import org.eclipse.jpt.jpa.core.prefs.JpaValidationPreferencesManager;
 import org.eclipse.wst.validation.internal.core.Message;
 import org.eclipse.wst.validation.internal.provisional.core.IMessage;
 import org.jboss.tools.hibernate.jpt.core.internal.HibernateJptPlugin;
@@ -28,26 +30,46 @@
 	private static TextRange DEFAULT_TEXT_RANGE = TextRange.Empty.instance();
 	
 	public static IMessage buildMessage(
-			int defaultSeverity, String messageId, Object targetObject) {
+			int defaultSeverity, String messageId, JpaNode targetObject) {
 		return buildMessage(defaultSeverity, messageId, DEFAULT_PARMS, targetObject);
 	}
 	
 	public static IMessage buildMessage(
-			int defaultSeverity, String messageId, String[] parms, Object targetObject) {
+			int defaultSeverity, String messageId, String[] parms, JpaNode targetObject) {
 		return buildMessage(defaultSeverity, messageId, parms, targetObject, DEFAULT_TEXT_RANGE);
 	}
 	
 	public static IMessage buildMessage(
-			int defaultSeverity, String messageId, Object targetObject, TextRange textRange) {
+			int defaultSeverity, String messageId, JpaNode targetObject, TextRange textRange) {
 		return buildMessage(defaultSeverity, messageId, DEFAULT_PARMS, targetObject, textRange);
 	}
 	
 	public static IMessage buildMessage(
-			int defaultSeverity, String messageId, String[] parms, Object targetObject, TextRange textRange) {
+			int defaultSeverity, String messageId, String[] parms, JpaNode targetObject, TextRange textRange) {
+		return buildMessage(defaultSeverity, messageId, parms, targetObject.getResource(), DEFAULT_TEXT_RANGE);
+	}
+
+	public static IMessage buildMessage(
+			int defaultSeverity, String messageId, IResource targetObject) {
+		return buildMessage(defaultSeverity, messageId, DEFAULT_PARMS, targetObject);
+	}
+	
+	public static IMessage buildMessage(
+			int defaultSeverity, String messageId, String[] parms, IResource targetObject) {
+		return buildMessage(defaultSeverity, messageId, parms, targetObject, DEFAULT_TEXT_RANGE);
+	}
+	
+	public static IMessage buildMessage(
+			int defaultSeverity, String messageId, IResource targetObject, TextRange textRange) {
+		return buildMessage(defaultSeverity, messageId, DEFAULT_PARMS, targetObject, textRange);
+	}
+	
+	public static IMessage buildMessage(
+			int defaultSeverity, String messageId, String[] parms, IResource targetObject, TextRange textRange) {
 		
 		//determine whether default severity should be overridden
 		int severity = defaultSeverity;
-		int severityPreference = JpaValidationPreferences.getProblemSeverityPreference(targetObject, messageId);
+		int severityPreference = JpaValidationPreferencesManager.getProblemSeverityPreference(targetObject, messageId);
 		if (severityPreference != -1){
 			severity = severityPreference;
 		}

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/HibernateJpaPlatformUiProvider.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/HibernateJpaPlatformUiProvider.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/HibernateJpaPlatformUiProvider.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -12,7 +12,6 @@
 
 import java.util.List;
 
-import org.eclipse.jpt.jpa.ui.JpaPlatformUi;
 import org.eclipse.jpt.jpa.ui.JpaPlatformUiProvider;
 import org.eclipse.jpt.jpa.ui.ResourceUiDefinition;
 import org.eclipse.jpt.jpa.ui.details.JpaDetailsProvider;
@@ -22,13 +21,11 @@
 import org.eclipse.jpt.jpa.ui.internal.details.orm.EntityMappingsDetailsProvider;
 import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmPersistentAttributeDetailsProvider;
 import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmPersistentTypeDetailsProvider;
-import org.eclipse.jpt.jpa.ui.internal.platform.generic.GenericNavigatorProvider;
 import org.jboss.tools.hibernate.jpt.ui.internal.details.java.JavaPackageInfoDetailsProvider;
 import org.jboss.tools.hibernate.jpt.ui.internal.mapping.details.java.HibernateJavaResourceUiDefinition;
 import org.jboss.tools.hibernate.jpt.ui.internal.mapping.details.java.PackageInfoResourceUIDefinition;
 import org.jboss.tools.hibernate.jpt.ui.internal.mapping.details.orm.HibernateOrmXmlUiDefinition;
 import org.jboss.tools.hibernate.jpt.ui.internal.persistence.details.HibernatePersistenceXmlUiDefinition;
-import org.jboss.tools.hibernate.jpt.ui.internal.platform.HibernateJpaPlatformUi;
 
 /**
  * @author Dmitry Geraskov
@@ -53,17 +50,7 @@
 	private HibernateJpaPlatformUiProvider() {
 		super();
 	}
-
-	
-	public JpaPlatformUi buildJpaPlatformUi() {
-		return new HibernateJpaPlatformUi(
-			new GenericNavigatorProvider(),
-			HibernateJpaPlatformUiProvider.instance()
-		);
-	}
-
 	// ********** details providers **********
-	
 	@Override
 	protected void addDetailsProvidersTo(List<JpaDetailsProvider> providers) {
 		providers.add(JavaPackageInfoDetailsProvider.instance());
@@ -74,7 +61,6 @@
 		providers.add(OrmPersistentAttributeDetailsProvider.instance());
 	}
 	
-	
 	// ********** resource ui definitions **********
 	
 	@Override

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/details/HibernateTableComposite.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/details/HibernateTableComposite.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/details/HibernateTableComposite.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -12,11 +12,13 @@
 
 import java.util.Collection;
 
+import javax.persistence.Table;
+
 import org.eclipse.jpt.common.ui.internal.util.PaneEnabler;
 import org.eclipse.jpt.common.ui.internal.widgets.Pane;
 import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
+import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
 import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
 import org.eclipse.jpt.jpa.db.Schema;
 import org.eclipse.jpt.jpa.db.SchemaContainer;
 import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds;
@@ -115,7 +117,7 @@
 		new PaneEnabler(buildTableEnabledHolder(), this);
 	}
 	
-	protected WritablePropertyValueModel<HibernateTable> buildTableHolder() {
+	protected ModifiablePropertyValueModel<HibernateTable> buildTableHolder() {
 		
 		return new PropertyAspectAdapter<HibernateEntity, HibernateTable>(getSubjectHolder(), HibernateEntity.TABLE_IS_UNDEFINED_PROPERTY) {
 			@Override
@@ -125,7 +127,7 @@
 		};
 	}
 	
-	protected WritablePropertyValueModel<Boolean> buildTableEnabledHolder() {
+	protected ModifiablePropertyValueModel<Boolean> buildTableEnabledHolder() {
 		return new PropertyAspectAdapter<HibernateEntity, Boolean>(getSubjectHolder(), HibernateEntity.SPECIFIED_TABLE_IS_ALLOWED_PROPERTY) {
 			@Override
 			protected Boolean buildValue_() {

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/details/PackageInfoDetailsPage.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/details/PackageInfoDetailsPage.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/details/PackageInfoDetailsPage.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -13,8 +13,8 @@
 import org.eclipse.jpt.common.ui.WidgetFactory;
 import org.eclipse.jpt.common.ui.internal.util.PaneEnabler;
 import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
+import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
 import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
 import org.eclipse.jpt.jpa.ui.internal.details.AbstractJpaDetailsPage;
 import org.eclipse.swt.widgets.Composite;
 import org.jboss.tools.hibernate.jpt.core.internal.context.HibernateGeneratorContainer;
@@ -48,7 +48,7 @@
 		new PaneEnabler(buildWidgetsEnabledHolder(), this);
 	}
 	
-	protected WritablePropertyValueModel<Boolean> buildWidgetsEnabledHolder() {
+	protected ModifiablePropertyValueModel<Boolean> buildWidgetsEnabledHolder() {
 		return new PropertyAspectAdapter<HibernatePackageInfo, Boolean>(getSubjectHolder()) {
 			@Override
 			protected Boolean buildValue_() {

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/details/java/JavaPackageInfoDetailsProvider.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/details/java/JavaPackageInfoDetailsProvider.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/details/java/JavaPackageInfoDetailsProvider.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -14,11 +14,14 @@
 import org.eclipse.jpt.common.ui.WidgetFactory;
 import org.eclipse.jpt.common.utility.internal.Tools;
 import org.eclipse.jpt.jpa.core.JpaStructureNode;
-import org.eclipse.jpt.jpa.core.context.java.JavaStructureNodes;
-import org.eclipse.jpt.jpa.ui.details.JpaDetailsPage;
+import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
+import org.eclipse.jpt.jpa.core.context.orm.EntityMappings;
+import org.eclipse.jpt.jpa.ui.details.JpaDetailsPageManager;
 import org.eclipse.jpt.jpa.ui.details.JpaDetailsProvider;
+import org.eclipse.jpt.jpa.ui.internal.details.orm.EntityMappingsDetailsPage;
 import org.eclipse.swt.widgets.Composite;
 import org.jboss.tools.hibernate.jpt.core.internal.context.java.HibernatePackageInfo;
+import org.jboss.tools.hibernate.jpt.core.internal.context.java.JavaPackageInfo;
 import org.jboss.tools.hibernate.jpt.ui.internal.details.PackageInfoDetailsPage;
 
 /**
@@ -46,16 +49,17 @@
 		super();
 	}
 	
-	
+	@Override
 	public boolean providesDetails(JpaStructureNode structureNode) {
-			return Tools.valuesAreEqual(structureNode.getId(), JavaStructureNodes.COMPILATION_UNIT_ID)
+			return Tools.valuesAreEqual(structureNode.getType(),  JavaPackageInfo.class)
 				&& structureNode.getResourceType().getContentType().equals(JptCommonCorePlugin.JAVA_SOURCE_PACKAGE_INFO_CONTENT_TYPE);
 	}
 	
-	public JpaDetailsPage<HibernatePackageInfo> buildDetailsPage(
+	@Override
+	public JpaDetailsPageManager<HibernatePackageInfo> buildDetailsPageManager(
 			Composite parent,
 			WidgetFactory widgetFactory) {
-		
+	
 		return new PackageInfoDetailsPage(parent, widgetFactory);
 	}
 

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/jpa2/details/HibernateElementCollectionMapping2_0Composite.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/jpa2/details/HibernateElementCollectionMapping2_0Composite.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/jpa2/details/HibernateElementCollectionMapping2_0Composite.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -16,12 +16,11 @@
 import org.eclipse.jpt.common.ui.WidgetFactory;
 import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
 import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
+import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
 import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
 import org.eclipse.jpt.jpa.core.context.Converter;
 import org.eclipse.jpt.jpa.core.context.ConvertibleMapping;
 import org.eclipse.jpt.jpa.core.jpa2.context.ElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.ui.internal.details.JptUiDetailsMessages;
 import org.eclipse.jpt.jpa.ui.internal.jpa2.details.AbstractElementCollectionMapping2_0Composite;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Control;
@@ -70,7 +69,7 @@
 		
 	}
 	
-	private WritablePropertyValueModel<Boolean> buildTypeBooleanHolder() {
+	private ModifiablePropertyValueModel<Boolean> buildTypeBooleanHolder() {
 		return new PropertyAspectAdapter<ElementCollectionMapping2_0, Boolean>(getSubjectHolder(), ConvertibleMapping.CONVERTER_PROPERTY) {
 			@Override
 			protected Boolean buildValue_() {

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/jpa2/mapping/details/orm/Hibernate2_0OrmXmlUiDefinition.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/jpa2/mapping/details/orm/Hibernate2_0OrmXmlUiDefinition.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/jpa2/mapping/details/orm/Hibernate2_0OrmXmlUiDefinition.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -13,6 +13,7 @@
 import java.util.List;
 
 import org.eclipse.jpt.common.core.JptResourceType;
+import org.eclipse.jpt.common.ui.jface.ItemTreeStateProviderFactoryProvider;
 import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
 import org.eclipse.jpt.jpa.core.context.AttributeMapping;
 import org.eclipse.jpt.jpa.core.context.TypeMapping;
@@ -34,9 +35,8 @@
 import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmOneToOneMappingUiDefinition;
 import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmTransientMappingUiDefinition;
 import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmVersionMappingUiDefinition;
+import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmXmlUiDefinition;
 import org.eclipse.jpt.jpa.ui.internal.jpa2.details.orm.OrmElementCollectionMapping2_0UiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.structure.OrmResourceModelStructureProvider;
-import org.eclipse.jpt.jpa.ui.structure.JpaStructureProvider;
 
 
 /**
@@ -74,8 +74,8 @@
 		return resourceType.equals(JptJpaCorePlugin.ORM_XML_2_0_RESOURCE_TYPE);
 	}
 	
-	public JpaStructureProvider getStructureProvider() {
-		return OrmResourceModelStructureProvider.instance();
+	public ItemTreeStateProviderFactoryProvider getStructureViewFactoryProvider() {
+		return OrmXmlUiDefinition.STRUCTURE_VIEW_FACTORY_PROVIDER;
 	}
 	
 	@Override

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/GenericGeneratorComposite.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/GenericGeneratorComposite.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/GenericGeneratorComposite.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -14,8 +14,8 @@
 import org.eclipse.jpt.common.utility.internal.StringConverter;
 import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
 import org.eclipse.jpt.common.utility.internal.model.value.SimpleListValueModel;
+import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
 import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
 import org.eclipse.jpt.jpa.ui.internal.details.GeneratorComposite;
 import org.eclipse.swt.widgets.Composite;
 import org.jboss.tools.hibernate.jpt.core.internal.context.GenericGenerator;
@@ -61,7 +61,7 @@
 		new ParametersComposite(this, container, getSubjectHolder());
 	}
 	
-	protected WritablePropertyValueModel<String> buildStrategyHolder() {
+	protected ModifiablePropertyValueModel<String> buildStrategyHolder() {
 		return new PropertyAspectAdapter<GenericGenerator, String>(getSubjectHolder(),
 				GenericGenerator.GENERIC_STRATEGY_PROPERTY) {
 			@Override

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/GenericGeneratorsComposite.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/GenericGeneratorsComposite.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/GenericGeneratorsComposite.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -28,8 +28,8 @@
 import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
 import org.eclipse.jpt.common.utility.internal.model.value.swing.ObjectListSelectionModel;
 import org.eclipse.jpt.common.utility.model.value.ListValueModel;
+import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
 import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
 import org.eclipse.jpt.jpa.ui.internal.details.GeneratorComposite.GeneratorBuilder;
 import org.eclipse.osgi.util.NLS;
 import org.eclipse.swt.SWT;
@@ -51,7 +51,7 @@
 
 	private AddRemoveListPane<HibernateGeneratorContainer> listPane;
 	Pane<? extends GenericGenerator> genericGeneratorPane;
-	private WritablePropertyValueModel<GenericGenerator> generatorHolder;
+	private ModifiablePropertyValueModel<GenericGenerator> generatorHolder;
 	private NewNameDialogBuilder dialogBuilder = null;
 
 	public GenericGeneratorsComposite(
@@ -114,12 +114,12 @@
 		{
 			@Override
 			protected ListIterator<GenericGenerator> listIterator_() {
-				return (ListIterator<GenericGenerator>) this.subject.genericGenerators();
+				return (ListIterator<GenericGenerator>) this.subject.getGenericGenerators().iterator();
 			}
 
 			@Override
 			protected int size_() {
-				return this.subject.genericGeneratorsSize();
+				return this.subject.getGenericGeneratorsSize();
 			}
 		};
 	}
@@ -164,7 +164,7 @@
 				String name = generator.getName();
 
 				if (name == null) {
-					int index = CollectionTools.indexOf(getSubject().genericGenerators(), generator);
+					int index = CollectionTools.indexOf(getSubject().getGenericGenerators(), generator);
 					name = NLS.bind(HibernateUIMappingMessages.GenericGeneratorsComposite_displayString, Integer.valueOf(index));
 				}
 
@@ -173,7 +173,7 @@
 		};
 	}
 
-	private WritablePropertyValueModel<GenericGenerator> buildGenericGeneratorHolder() {
+	private ModifiablePropertyValueModel<GenericGenerator> buildGenericGeneratorHolder() {
 		return new SimplePropertyValueModel<GenericGenerator>();
 	}
 
@@ -218,7 +218,7 @@
 		return new GeneratorBuilder<GenericGenerator>() {
 			public GenericGenerator addGenerator() {
 				HibernateJavaGeneratorContainer container = (HibernateJavaGeneratorContainer)getSubject();
-				JavaGenericGenerator generator = container.addGenericGenerator(container.genericGeneratorsSize());
+				JavaGenericGenerator generator = container.addGenericGenerator(container.getGenericGeneratorsSize());
 				generatorHolder.setValue(generator);
 				return generator;
 			}
@@ -229,7 +229,7 @@
 		new ControlSwitcher(this.getGenericGeneratorHolder(), this.buildPaneTransformer(), pageBook);
 	}
 	
-	protected WritablePropertyValueModel<GenericGenerator> getGenericGeneratorHolder() {
+	protected ModifiablePropertyValueModel<GenericGenerator> getGenericGeneratorHolder() {
 		return generatorHolder;
 	}
 	

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateAbstractInheritanceComposite.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateAbstractInheritanceComposite.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateAbstractInheritanceComposite.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -19,8 +19,8 @@
 import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
 import org.eclipse.jpt.common.utility.internal.model.value.PropertyListValueModelAdapter;
 import org.eclipse.jpt.common.utility.model.value.ListValueModel;
+import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
 import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
 import org.eclipse.jpt.jpa.core.context.Entity;
 import org.eclipse.jpt.jpa.core.context.InheritanceType;
 import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds;
@@ -156,7 +156,7 @@
 		addPrimaryKeyJoinColumnsComposite(addSubPane(container, 5));
 	}
 
-	protected WritablePropertyValueModel<Boolean> buildDiscriminatorValueEnabledHolder() {
+	protected ModifiablePropertyValueModel<Boolean> buildDiscriminatorValueEnabledHolder() {
 		return new PropertyAspectAdapter<Entity, Boolean>(getSubjectHolder(), Entity.SPECIFIED_DISCRIMINATOR_VALUE_IS_ALLOWED_PROPERTY) {
 			@Override
 			protected Boolean buildValue_() {
@@ -171,7 +171,7 @@
 		);
 	}
 
-	private WritablePropertyValueModel<String> buildDefaultDiscriminatorValueHolder() {
+	private ModifiablePropertyValueModel<String> buildDefaultDiscriminatorValueHolder() {
 		return new PropertyAspectAdapter<Entity, String>(getSubjectHolder(), Entity.DEFAULT_DISCRIMINATOR_VALUE_PROPERTY, Entity.DISCRIMINATOR_VALUE_IS_UNDEFINED_PROPERTY) {
 			@Override
 			protected String buildValue_() {
@@ -234,7 +234,7 @@
 		};
 	}
 
-	private WritablePropertyValueModel<String> buildDiscriminatorValueHolder() {
+	private ModifiablePropertyValueModel<String> buildDiscriminatorValueHolder() {
 		return new PropertyAspectAdapter<Entity, String>(getSubjectHolder(), Entity.SPECIFIED_DISCRIMINATOR_VALUE_PROPERTY) {
 			@Override
 			protected String buildValue_() {
@@ -283,12 +283,17 @@
 
 			@Override
 			protected String displayString(InheritanceType value) {
-				return buildDisplayString(
-					JptUiDetailsMessages.class,
-					AbstractInheritanceComposite.class,
-					value
-				);
+				switch (value) {
+				case JOINED :
+					return JptUiDetailsMessages.AbstractInheritanceComposite_joined;
+				case SINGLE_TABLE :
+					return JptUiDetailsMessages.AbstractInheritanceComposite_single_table;
+				case TABLE_PER_CLASS :
+					return JptUiDetailsMessages.AbstractInheritanceComposite_table_per_class;
+				default :
+					throw new IllegalStateException();
 			}
+			}
 
 			@Override
 			protected InheritanceType getValue() {

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateAddQueryDialog.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateAddQueryDialog.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateAddQueryDialog.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -25,7 +25,7 @@
 import org.eclipse.jpt.common.utility.internal.node.Node;
 import org.eclipse.jpt.common.utility.internal.node.Problem;
 import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
+import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
 import org.eclipse.jpt.jpa.core.context.Query;
 import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
 import org.eclipse.jpt.jpa.ui.internal.details.JptUiDetailsMessages;
@@ -182,7 +182,7 @@
 			};
 		}
 
-		private WritablePropertyValueModel<String> buildNameHolder() {
+		private ModifiablePropertyValueModel<String> buildNameHolder() {
 			return new PropertyAspectAdapter<AddQueryStateObject, String>(getSubjectHolder(), AddQueryStateObject.NAME_PROPERTY) {
 				@Override
 				protected String buildValue_() {
@@ -196,7 +196,7 @@
 			};
 		}
 
-		private WritablePropertyValueModel<String> buildQueryTypeHolder() {
+		private ModifiablePropertyValueModel<String> buildQueryTypeHolder() {
 			return new PropertyAspectAdapter<AddQueryStateObject, String>(getSubjectHolder(), AddQueryStateObject.QUERY_TYPE_PROPERTY) {
 				@Override
 				protected String buildValue_() {
@@ -285,9 +285,8 @@
 
 	private List<String> names(){
 		List<String> names = new ArrayList<String>();
-		for (Iterator<Query> queries = this.pUnit.queries(); queries.hasNext();){
-			String name = queries.next().getName();
-			names.add(name);
+		for (Query query : this.pUnit.getQueries()) {
+			names.add(query.getName());
 		}
 		return names;
 }

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateColumnComposite.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateColumnComposite.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateColumnComposite.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -19,8 +19,8 @@
 import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
 import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
 import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
+import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
 import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
 import org.eclipse.jpt.jpa.core.context.BaseColumn;
 import org.eclipse.jpt.jpa.core.context.Column;
 import org.eclipse.jpt.jpa.core.context.NamedColumn;
@@ -224,7 +224,7 @@
 		};
 	}
 
-	private WritablePropertyValueModel<String> buildColumnDefinitionHolder() {
+	private ModifiablePropertyValueModel<String> buildColumnDefinitionHolder() {
 		return new PropertyAspectAdapter<Column, String>(getSubjectHolder(), NamedColumn.COLUMN_DEFINITION_PROPERTY) {
 			@Override
 			protected String buildValue_() {
@@ -241,7 +241,7 @@
 		};
 	}
 	
-	private WritablePropertyValueModel<Boolean> buildInsertableHolder() {
+	private ModifiablePropertyValueModel<Boolean> buildInsertableHolder() {
 		return new PropertyAspectAdapter<Column, Boolean>(getSubjectHolder(), BaseColumn.SPECIFIED_INSERTABLE_PROPERTY) {
 			@Override
 			protected Boolean buildValue_() {
@@ -280,7 +280,7 @@
 	}
 
 
-	private WritablePropertyValueModel<Boolean> buildNullableHolder() {
+	private ModifiablePropertyValueModel<Boolean> buildNullableHolder() {
 		return new PropertyAspectAdapter<Column, Boolean>(
 				getSubjectHolder(),
 				BaseColumn.SPECIFIED_NULLABLE_PROPERTY) {
@@ -390,7 +390,7 @@
 			}
 			
 			protected Iterator<String> values() {
-				return this.getSubject().candidateTableNames();
+				return this.getSubject().getCandidateTableNames().iterator();
 			}
 			
 			@Override
@@ -400,7 +400,7 @@
 		};
 	}
 
-	private WritablePropertyValueModel<Boolean> buildUniqueHolder() {
+	private ModifiablePropertyValueModel<Boolean> buildUniqueHolder() {
 		return new PropertyAspectAdapter<Column, Boolean>(
 				getSubjectHolder(),
 				BaseColumn.SPECIFIED_UNIQUE_PROPERTY) {
@@ -448,7 +448,7 @@
 		};
 	}
 	
-	private WritablePropertyValueModel<Boolean> buildUpdatableHolder() {
+	private ModifiablePropertyValueModel<Boolean> buildUpdatableHolder() {
 		return new PropertyAspectAdapter<Column, Boolean>(
 				getSubjectHolder(),
 				BaseColumn.DEFAULT_UPDATABLE_PROPERTY,
@@ -616,7 +616,7 @@
 				}
 				
 				@Override
-				protected WritablePropertyValueModel<Integer> buildSelectedItemHolder() {
+				protected ModifiablePropertyValueModel<Integer> buildSelectedItemHolder() {
 					return new PropertyAspectAdapter<Column, Integer>(getSubjectHolder(), Column.SPECIFIED_LENGTH_PROPERTY) {
 						@Override
 						protected Integer buildValue_() {
@@ -656,7 +656,7 @@
 				}
 				
 				@Override
-				protected WritablePropertyValueModel<Integer> buildSelectedItemHolder() {
+				protected ModifiablePropertyValueModel<Integer> buildSelectedItemHolder() {
 					return new PropertyAspectAdapter<Column, Integer>(getSubjectHolder(), Column.SPECIFIED_PRECISION_PROPERTY) {
 						@Override
 						protected Integer buildValue_() {
@@ -696,7 +696,7 @@
 				}
 				
 				@Override
-				protected WritablePropertyValueModel<Integer> buildSelectedItemHolder() {
+				protected ModifiablePropertyValueModel<Integer> buildSelectedItemHolder() {
 					return new PropertyAspectAdapter<Column, Integer>(getSubjectHolder(), Column.SPECIFIED_SCALE_PROPERTY) {
 						@Override
 						protected Integer buildValue_() {

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateDiscriminatorColumnComposite.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateDiscriminatorColumnComposite.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateDiscriminatorColumnComposite.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -19,8 +19,8 @@
 import org.eclipse.jpt.common.ui.internal.widgets.Pane;
 import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
 import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
+import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
 import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
 import org.eclipse.jpt.jpa.core.context.DiscriminatorColumn;
 import org.eclipse.jpt.jpa.core.context.DiscriminatorType;
 import org.eclipse.jpt.jpa.core.context.Entity;
@@ -71,7 +71,7 @@
  */
 public class HibernateDiscriminatorColumnComposite extends Pane<HibernateJavaEntity> {
 
-	private WritablePropertyValueModel<DiscriminatorFormula> discriminatorFormulaHolder;
+	private ModifiablePropertyValueModel<DiscriminatorFormula> discriminatorFormulaHolder;
 
 	/**
 	 * Creates a new <code>InheritanceComposite</code>.
@@ -191,7 +191,7 @@
 		};
 	}
 
-	private WritablePropertyValueModel<String> buildDiscriminatorFormulaValueHolder() {
+	private ModifiablePropertyValueModel<String> buildDiscriminatorFormulaValueHolder() {
 		return new PropertyAspectAdapter<DiscriminatorFormula, String>(this.discriminatorFormulaHolder, DiscriminatorFormula.VALUE_PROPERTY) {
 			@Override
 			protected String buildValue_() {
@@ -260,18 +260,23 @@
 
 			@Override
 			protected String displayString(DiscriminatorType value) {
-				return buildDisplayString(
-					JptUiDetailsMessages.class,
-					DiscriminatorColumnComposite.class,
-					value
-				);
+				switch (value) {
+					case CHAR :
+						return JptUiDetailsMessages.DiscriminatorColumnComposite_char;
+					case INTEGER :
+						return JptUiDetailsMessages.DiscriminatorColumnComposite_integer;
+					case STRING :
+						return JptUiDetailsMessages.DiscriminatorColumnComposite_string;
+					default :
+						throw new IllegalStateException();
+				}
 			}
-
+			
 			@Override
 			protected String nullDisplayString() {
 				return JptCommonUiMessages.NoneSelected;
 			}
-
+			
 			@Override
 			protected DiscriminatorType getValue() {
 				return getSubject().getSpecifiedDiscriminatorType();
@@ -284,7 +289,7 @@
 		};
 	}
 
-	protected WritablePropertyValueModel<Boolean> buildDiscriminatorColumnEnabledHolder() {
+	protected ModifiablePropertyValueModel<Boolean> buildDiscriminatorColumnEnabledHolder() {
 		return new PropertyAspectAdapter<Entity, Boolean>(getSubjectHolder(), Entity.SPECIFIED_DISCRIMINATOR_COLUMN_IS_ALLOWED_PROPERTY) {
 			@Override
 			protected Boolean buildValue_() {
@@ -338,7 +343,7 @@
 				}
 
 				@Override
-				protected WritablePropertyValueModel<Integer> buildSelectedItemHolder() {
+				protected ModifiablePropertyValueModel<Integer> buildSelectedItemHolder() {
 					return new PropertyAspectAdapter<DiscriminatorColumn, Integer>(getSubjectHolder(), DiscriminatorColumn.SPECIFIED_LENGTH_PROPERTY) {
 						@Override
 						protected Integer buildValue_() {
@@ -354,7 +359,7 @@
 			};
 		}
 
-		private WritablePropertyValueModel<String> buildColumnDefinitionHolder(PropertyValueModel<DiscriminatorColumn> discriminatorColumnHolder) {
+		private ModifiablePropertyValueModel<String> buildColumnDefinitionHolder(PropertyValueModel<DiscriminatorColumn> discriminatorColumnHolder) {
 
 			return new PropertyAspectAdapter<DiscriminatorColumn, String>(discriminatorColumnHolder, NamedColumn.COLUMN_DEFINITION_PROPERTY) {
 				@Override
@@ -373,7 +378,7 @@
 		}
 	}
 	
-	private WritablePropertyValueModel<DiscriminatorFormula> buildDiscriminatorFormulaHolder() {
+	private ModifiablePropertyValueModel<DiscriminatorFormula> buildDiscriminatorFormulaHolder() {
 		return new PropertyAspectAdapter<HibernateJavaEntity, DiscriminatorFormula>(getSubjectHolder(), HibernateEntity.DISCRIMINATOR_FORMULA_PROPERTY) {
 			@Override
 			protected DiscriminatorFormula buildValue_() {

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateGenerationComposite.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateGenerationComposite.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateGenerationComposite.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -13,8 +13,8 @@
 import org.eclipse.jpt.common.ui.internal.widgets.Pane;
 import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
 import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
+import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
 import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
 import org.eclipse.jpt.jpa.core.context.AttributeMapping;
 import org.eclipse.jpt.jpa.core.context.GeneratorContainer;
 import org.eclipse.jpt.jpa.ui.internal.details.GenerationComposite;
@@ -32,8 +32,8 @@
  */
 public class HibernateGenerationComposite extends GenerationComposite {
 	
-	private WritablePropertyValueModel<Boolean> genericGeneratorExpansionStateHolder;
-	private WritablePropertyValueModel<GenericGenerator> generatorHolder;
+	private ModifiablePropertyValueModel<Boolean> genericGeneratorExpansionStateHolder;
+	private ModifiablePropertyValueModel<GenericGenerator> generatorHolder;
 	
 	public HibernateGenerationComposite(Pane<?> parentPane,
 			PropertyValueModel<? extends HibernateGeneratorContainer> subjectHolder,
@@ -48,7 +48,7 @@
 		this.generatorHolder = buildGeneratorHolder();
 	}
 	
-	private WritablePropertyValueModel<GenericGenerator> buildGeneratorHolder() {
+	private ModifiablePropertyValueModel<GenericGenerator> buildGeneratorHolder() {
 		return new SimplePropertyValueModel<GenericGenerator>();
 	}
 	
@@ -61,8 +61,8 @@
 	protected void doPopulate() {
 		super.doPopulate();
 		this.genericGeneratorExpansionStateHolder .setValue(Boolean.valueOf(getSubject() != null
-				&& getSubject().genericGeneratorsSize() > 0));
-		this.generatorHolder.setValue(getSubject() != null && getSubject().genericGeneratorsSize() > 0 ? getSubject().genericGenerators().next() : null);
+				&& getSubject().getGenericGeneratorsSize() > 0));
+		this.generatorHolder.setValue(getSubject() != null && getSubject().getGenericGeneratorsSize() > 0 ? getSubject().getGenericGenerators().iterator().next() : null);
 	}
 	
 	@Override
@@ -90,8 +90,8 @@
 		
 		
 		if (getSubjectHolder().getValue().getParent() instanceof AttributeMapping){
-			if (getSubject().genericGeneratorsSize() > 0){
-				generatorHolder.setValue(getSubject().genericGenerators().next());
+			if (getSubject().getGenericGeneratorsSize() > 0){
+				generatorHolder.setValue(getSubject().getGenericGenerators().iterator().next());
 			}
 			// Generic Generator pane
 			this.addGenericGeneratorComposite(
@@ -121,7 +121,7 @@
 		return new GeneratorBuilder<GenericGenerator>() {
 			public GenericGenerator addGenerator() {
 				HibernateJavaGeneratorContainer container = (HibernateJavaGeneratorContainer)getSubject();
-				JavaGenericGenerator generator = container.addGenericGenerator(container.genericGeneratorsSize());
+				JavaGenericGenerator generator = container.addGenericGenerator(container.getGenericGeneratorsSize());
 				generatorHolder.setValue(generator);
 				return generator;
 			}
@@ -145,21 +145,21 @@
 		};
 	}*/
 	
-	private WritablePropertyValueModel<Boolean> buildGenericGeneratorBooleanHolder() {
+	private ModifiablePropertyValueModel<Boolean> buildGenericGeneratorBooleanHolder() {
 		return new PropertyAspectAdapter<GeneratorContainer, Boolean>(getSubjectHolder(), HibernateGeneratorContainer.GENERIC_GENERATORS_LIST) {
 			@Override
 			protected Boolean buildValue_() {
-				return Boolean.valueOf(((HibernateJavaGeneratorContainer)subject).genericGeneratorsSize() > 0);
+				return Boolean.valueOf(((HibernateJavaGeneratorContainer)subject).getGenericGeneratorsSize() > 0);
 			}
 
 			@Override
 			protected void setValue_(Boolean value) {
 				HibernateJavaGeneratorContainer container = (HibernateJavaGeneratorContainer)subject;
 				if (value.booleanValue()) {
-					JavaGenericGenerator gc = container.addGenericGenerator(container.genericGeneratorsSize());
+					JavaGenericGenerator gc = container.addGenericGenerator(container.getGenericGeneratorsSize());
 					generatorHolder.setValue(gc);
 				} else if (!value.booleanValue()) {
-					for (int i = 0; i < container.genericGeneratorsSize(); i++) {
+					for (int i = 0; i < container.getGenericGeneratorsSize(); i++) {
 						container.removeGenericGenerator(0);
 					}
 					generatorHolder.setValue(null);

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateNamedNativeQueryPropertyComposite.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateNamedNativeQueryPropertyComposite.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateNamedNativeQueryPropertyComposite.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -14,8 +14,8 @@
 import org.eclipse.jpt.common.ui.internal.widgets.ClassChooserPane;
 import org.eclipse.jpt.common.ui.internal.widgets.Pane;
 import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
+import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
 import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
 import org.eclipse.jpt.jpa.ui.internal.details.JptUiDetailsMessages;
 import org.eclipse.swt.widgets.Composite;
 import org.jboss.tools.hibernate.jpt.core.internal.context.HibernateNamedNativeQuery;
@@ -48,7 +48,7 @@
 		return new ClassChooserPane<HibernateNamedNativeQuery>(this, container) {
 
 			@Override
-			protected WritablePropertyValueModel<String> buildTextHolder() {
+			protected ModifiablePropertyValueModel<String> buildTextHolder() {
 				return new PropertyAspectAdapter<HibernateNamedNativeQuery, String>(getSubjectHolder(), HibernateNamedNativeQuery.RESULT_CLASS_PROPERTY) {
 					@Override
 					protected String buildValue_() {

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateQueriesComposite.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateQueriesComposite.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateQueriesComposite.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -30,12 +30,15 @@
 import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
 import org.eclipse.jpt.common.utility.internal.model.value.swing.ObjectListSelectionModel;
 import org.eclipse.jpt.common.utility.model.value.ListValueModel;
+import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
 import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
 import org.eclipse.jpt.jpa.core.context.NamedNativeQuery;
 import org.eclipse.jpt.jpa.core.context.NamedQuery;
 import org.eclipse.jpt.jpa.core.context.Query;
 import org.eclipse.jpt.jpa.core.context.QueryContainer;
+import org.eclipse.jpt.jpa.core.context.java.JavaNamedNativeQuery;
+import org.eclipse.jpt.jpa.core.context.java.JavaNamedQuery;
+import org.eclipse.jpt.jpa.core.context.java.JavaQueryContainer;
 import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds;
 import org.eclipse.jpt.jpa.ui.internal.details.JptUiDetailsMessages;
 import org.eclipse.jpt.jpa.ui.internal.details.NamedNativeQueryPropertyComposite;
@@ -64,7 +67,7 @@
 	private Pane<? extends NamedQuery> namedQueryPane;
 	private HibernateNamedQueryPropertyComposite hibernateNamedQueryPane;
 	private HibernateNamedNativeQueryPropertyComposite hibernateNamedNativeQueryPane;
-	private WritablePropertyValueModel<Query> queryHolder;
+	private ModifiablePropertyValueModel<Query> queryHolder;
 
 	/**
 	 * Creates a new <code>QueriesComposite</code>.
@@ -95,16 +98,16 @@
 		String queryType = hibernateAddQueryDialog.getQueryType();
 		Query query;
 		if (queryType == hibernateAddQueryDialog.NAMED_QUERY) {
-			query = this.getSubject().addNamedQuery(getSubject().namedQueriesSize());
+			query = this.getSubject().addNamedQuery(getSubject().getNamedQueriesSize());
 		}
 		else if (queryType == hibernateAddQueryDialog.NAMED_NATIVE_QUERY) {
-			query = this.getSubject().addNamedNativeQuery(this.getSubject().namedNativeQueriesSize());
+			query = this.getSubject().addNamedNativeQuery(this.getSubject().getNamedNativeQueriesSize());
 		}
 		else if (queryType == HibernateNamedQuery.HIBERNATE_NAMED_QUERY) {
-			query = this.getSubject().addHibernateNamedQuery(this.getSubject().hibernateNamedQueriesSize());
+			query = this.getSubject().addHibernateNamedQuery(this.getSubject().getHibernateNamedQueriesSize());
 		}
 		else if (queryType == HibernateNamedNativeQuery.HIBERNATE_NAMED_NATIVE_QUERY) {
-			query = this.getSubject().addHibernateNamedNativeQuery(this.getSubject().hibernateNamedNativeQueriesSize());
+			query = this.getSubject().addHibernateNamedNativeQuery(this.getSubject().getHibernateNamedNativeQueriesSize());
 		}
 		else {
 			throw new IllegalArgumentException();
@@ -133,19 +136,19 @@
 		);
 	}
 
-	private ListValueModel<NamedNativeQuery> buildNamedNativeQueriesListHolder() {
-		return new ListAspectAdapter<QueryContainer, NamedNativeQuery>(
+	private ListValueModel<JavaNamedNativeQuery> buildNamedNativeQueriesListHolder() {
+		return new ListAspectAdapter<JavaQueryContainer, JavaNamedNativeQuery>(
 			getSubjectHolder(),
 			QueryContainer.NAMED_NATIVE_QUERIES_LIST)
 		{
 			@Override
-			protected ListIterator<NamedNativeQuery> listIterator_() {
-				return this.subject.namedNativeQueries();
+			protected ListIterator<JavaNamedNativeQuery> listIterator_() {
+				return this.subject.getNamedNativeQueries().iterator();
 			}
 
 			@Override
 			protected int size_() {
-				return this.subject.namedNativeQueriesSize();
+				return this.subject.getNamedNativeQueriesSize();
 			}
 		};
 	}
@@ -160,52 +163,52 @@
 	}
 
 	private ListValueModel<HibernateJavaNamedQuery> buildHibernateNamedQueriesListHolder() {
-		return new ListAspectAdapter<QueryContainer, HibernateJavaNamedQuery>(
+		return new ListAspectAdapter<HibernateJavaQueryContainer, HibernateJavaNamedQuery>(
 			getSubjectHolder(),
 			HibernateJavaQueryContainer.HIBERNATE_NAMED_QUERIES_LIST)
 		{
 			@Override
 			protected ListIterator<HibernateJavaNamedQuery> listIterator_() {
-				return ((HibernateJavaQueryContainer)this.subject).hibernateNamedQueries();
+				return this.subject.getHibernateNamedQueries().iterator();
 			}
 
 			@Override
 			protected int size_() {
-				return ((HibernateJavaQueryContainer)this.subject).hibernateNamedQueriesSize();
+				return this.subject.getHibernateNamedQueriesSize();
 			}
 		};
 	}
 
 	private ListValueModel<HibernateJavaNamedNativeQuery> buildHibernateNamedNativeQueriesListHolder() {
-		return new ListAspectAdapter<QueryContainer, HibernateJavaNamedNativeQuery>(
+		return new ListAspectAdapter<HibernateJavaQueryContainer, HibernateJavaNamedNativeQuery>(
 			getSubjectHolder(),
 			HibernateJavaQueryContainer.HIBERNATE_NAMED_NATIVE_QUERIES_LIST)
 		{
 			@Override
 			protected ListIterator<HibernateJavaNamedNativeQuery> listIterator_() {
-				return ((HibernateJavaQueryContainer)this.subject).hibernateNamedNativeQueries();
+				return this.subject.getHibernateNamedNativeQueries().iterator();
 			}
 
 			@Override
 			protected int size_() {
-				return ((HibernateJavaQueryContainer)this.subject).hibernateNamedNativeQueriesSize();
+				return this.subject.getHibernateNamedNativeQueriesSize();
 			}
 		};
 	}
 
-	private ListValueModel<NamedQuery> buildNamedQueriesListHolder() {
-		return new ListAspectAdapter<QueryContainer, NamedQuery>(
+	private ListValueModel<JavaNamedQuery> buildNamedQueriesListHolder() {
+		return new ListAspectAdapter<HibernateJavaQueryContainer, JavaNamedQuery>(
 			getSubjectHolder(),
 			QueryContainer.NAMED_QUERIES_LIST)
 		{
 			@Override
-			protected ListIterator<NamedQuery> listIterator_() {
-				return this.subject.namedQueries();
+			protected ListIterator<JavaNamedQuery> listIterator_() {
+				return this.subject.getNamedQueries().iterator();
 			}
 
 			@Override
 			protected int size_() {
-				return this.subject.namedQueriesSize();
+				return this.subject.getNamedQueriesSize();
 			}
 		};
 	}
@@ -309,13 +312,13 @@
 					int index = -1;
 
 					if (query instanceof HibernateNamedQuery) {
-						index = CollectionTools.indexOf(getSubject().hibernateNamedQueries(), query);
+						index = CollectionTools.indexOf(getSubject().getHibernateNamedQueries(), query);
 					} else if (query instanceof HibernateNamedNativeQuery) {
-						index = CollectionTools.indexOf(getSubject().hibernateNamedNativeQueries(), query);
+						index = CollectionTools.indexOf(getSubject().getHibernateNamedNativeQueries(), query);
 					} else if (query instanceof NamedQuery) {
-						index = CollectionTools.indexOf(getSubject().namedQueries(), query);
+						index = CollectionTools.indexOf(getSubject().getNamedQueries(), query);
 					} else {
-						index = CollectionTools.indexOf(getSubject().namedNativeQueries(), query);
+						index = CollectionTools.indexOf(getSubject().getNamedNativeQueries(), query);
 					}
 
 					name = NLS.bind(JptUiDetailsMessages.QueriesComposite_displayString, index);
@@ -326,7 +329,7 @@
 		};
 	}
 
-	private WritablePropertyValueModel<Query> buildQueryHolder() {
+	private ModifiablePropertyValueModel<Query> buildQueryHolder() {
 		return new SimplePropertyValueModel<Query>();
 	}
 
@@ -391,7 +394,7 @@
 		new ControlSwitcher(this.queryHolder, buildPaneTransformer(), pageBook);
 	}
 
-	protected WritablePropertyValueModel<Query> getQueryHolder() {
+	protected ModifiablePropertyValueModel<Query> getQueryHolder() {
 		return this.queryHolder;
 	}
 

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateQueryPropertyComposite.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateQueryPropertyComposite.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateQueryPropertyComposite.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -19,8 +19,8 @@
 import org.eclipse.jpt.common.ui.internal.widgets.Pane;
 import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
 import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
+import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
 import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
 import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds;
 import org.eclipse.jpt.jpa.ui.internal.details.JptUiDetailsMessages;
 import org.eclipse.osgi.util.NLS;
@@ -166,7 +166,7 @@
 		};
 	}
 
-	private WritablePropertyValueModel<Integer> buildDefaultFetchSizeHolder() {
+	private ModifiablePropertyValueModel<Integer> buildDefaultFetchSizeHolder() {
 		return new PropertyAspectAdapter<HibernateQuery, Integer>(getSubjectHolder(), HibernateQuery.DEFAULT_FETCH_SIZE_PROPERTY) {
 			@Override
 			protected Integer buildValue_() {
@@ -175,7 +175,7 @@
 		};
 	}
 
-	protected WritablePropertyValueModel<String> buildNameTextHolder() {
+	protected ModifiablePropertyValueModel<String> buildNameTextHolder() {
 		return new PropertyAspectAdapter<HibernateQuery, String>(
 				getSubjectHolder(), HibernateQuery.NAME_PROPERTY) {
 			@Override
@@ -193,7 +193,7 @@
 		};
 	}
 
-	private WritablePropertyValueModel<String> buildQueryHolder() {
+	private ModifiablePropertyValueModel<String> buildQueryHolder() {
 		return new PropertyAspectAdapter<HibernateQuery, String>(getSubjectHolder(), HibernateQuery.QUERY_PROPERTY) {
 			@Override
 			protected String buildValue_() {
@@ -207,7 +207,7 @@
 		};
 	}
 
-	private WritablePropertyValueModel<Boolean> buildCacheableHolder() {
+	private ModifiablePropertyValueModel<Boolean> buildCacheableHolder() {
 		return new PropertyAspectAdapter<HibernateQuery, Boolean>(
 			getSubjectHolder(),
 			HibernateQuery.DEFAULT_CACHEABLE_PROPERTY,
@@ -249,7 +249,7 @@
 		};
 	}
 
-	private WritablePropertyValueModel<Boolean> buildReadOnlyHolder() {
+	private ModifiablePropertyValueModel<Boolean> buildReadOnlyHolder() {
 		return new PropertyAspectAdapter<HibernateQuery, Boolean>(
 			getSubjectHolder(),
 			HibernateQuery.DEFAULT_READ_ONLY_PROPERTY,
@@ -370,7 +370,7 @@
 		};
 	}
 
-	private WritablePropertyValueModel<String> buildCacheRegionTextHolder() {
+	private ModifiablePropertyValueModel<String> buildCacheRegionTextHolder() {
 		return new PropertyAspectAdapter<HibernateQuery, String>(
 				getSubjectHolder(),
 				HibernateQuery.DEFAULT_CACHE_REGION_PROPERTY,
@@ -390,7 +390,7 @@
 		};
 	}
 
-	private WritablePropertyValueModel<Integer> buildFetchSizeHolder() {
+	private ModifiablePropertyValueModel<Integer> buildFetchSizeHolder() {
 		return new PropertyAspectAdapter<HibernateQuery, Integer>(getSubjectHolder(), HibernateQuery.SPECIFIED_FETCH_SIZE_PROPERTY) {
 			@Override
 			protected Integer buildValue_() {
@@ -409,7 +409,7 @@
 
 
 
-	private WritablePropertyValueModel<Integer> buildTimeoutHolder() {
+	private ModifiablePropertyValueModel<Integer> buildTimeoutHolder() {
 		return new PropertyAspectAdapter<HibernateQuery, Integer>(getSubjectHolder(), HibernateQuery.SPECIFIED_TIMEOUT_PROPERTY) {
 			@Override
 			protected Integer buildValue_() {

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/IndexHolderComposite.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/IndexHolderComposite.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/IndexHolderComposite.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -13,7 +13,7 @@
 
 import org.eclipse.jpt.common.ui.internal.widgets.Pane;
 import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
+import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
 import org.eclipse.swt.widgets.Composite;
 import org.jboss.tools.hibernate.jpt.core.internal.context.IndexHolder;
 import org.jboss.tools.hibernate.jpt.core.internal.context.java.JavaIndex;
@@ -24,7 +24,7 @@
  */
 public class IndexHolderComposite extends Pane<IndexHolder> {
 	
-	private WritablePropertyValueModel<JavaIndex> indexHolder;
+	private ModifiablePropertyValueModel<JavaIndex> indexHolder;
 
 	protected IndexHolderComposite(Pane<? extends IndexHolder> parentPane,
 			Composite parent) {
@@ -49,7 +49,7 @@
 	}
 
 	
-	protected final WritablePropertyValueModel<String> buildIndexNameHolder() {
+	protected final ModifiablePropertyValueModel<String> buildIndexNameHolder() {
 		return new PropertyAspectAdapter<JavaIndex, String>(this.indexHolder, JavaIndex.INDEX_NAME) {
 			@Override
 			protected String buildValue_() {
@@ -88,7 +88,7 @@
 		};
 	}
 	
-	private WritablePropertyValueModel<JavaIndex> buildIndexHolder() {
+	private ModifiablePropertyValueModel<JavaIndex> buildIndexHolder() {
 		return new PropertyAspectAdapter<IndexHolder, JavaIndex>(getSubjectHolder(), IndexHolder.INDEX_PROPERTY) {
 			@Override
 			protected JavaIndex buildValue_() {

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/ParametersComposite.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/ParametersComposite.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/ParametersComposite.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -31,8 +31,8 @@
 import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
 import org.eclipse.jpt.common.utility.internal.model.value.swing.ObjectListSelectionModel;
 import org.eclipse.jpt.common.utility.model.value.ListValueModel;
+import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
 import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
 import org.eclipse.swt.graphics.Image;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Table;
@@ -46,7 +46,7 @@
  */
 public class ParametersComposite extends Pane<ParametrizedElement> {
 
-	private WritablePropertyValueModel<Parameter> parameterHolder;
+	private ModifiablePropertyValueModel<Parameter> parameterHolder;
 
 	/**
 	 * Creates a new <code>ParametersComposite</code>.
@@ -87,7 +87,7 @@
 		};
 	}
 
-	private WritablePropertyValueModel<Parameter> buildParameterHolder() {
+	private ModifiablePropertyValueModel<Parameter> buildParameterHolder() {
 		return new SimplePropertyValueModel<Parameter>();
 	};
 
@@ -138,7 +138,7 @@
 		static final int NAME_COLUMN_INDEX = 0;
 		static final int VALUE_COLUMN_INDEX = 1;
 
-		private WritablePropertyValueModel<String> buildNameHolder(Parameter subject) {
+		private ModifiablePropertyValueModel<String> buildNameHolder(Parameter subject) {
 			return new PropertyAspectAdapter<Parameter, String>(Parameter.NAME_PROPERTY, subject) {
 				@Override
 				protected String buildValue_() {
@@ -152,7 +152,7 @@
 			};
 		}
 
-		private WritablePropertyValueModel<?> buildValueHolder(Parameter subject) {
+		private ModifiablePropertyValueModel<?> buildValueHolder(Parameter subject) {
 			return new PropertyAspectAdapter<Parameter, String>(Parameter.VALUE_PROPERTY, subject) {
 				@Override
 				protected String buildValue_() {
@@ -167,8 +167,8 @@
 		}
 
 		@Override
-		public WritablePropertyValueModel<?>[] cellModels(Parameter subject) {
-			WritablePropertyValueModel<?>[] models = new WritablePropertyValueModel<?>[COLUMN_COUNT];
+		public ModifiablePropertyValueModel<?>[] cellModels(Parameter subject) {
+			ModifiablePropertyValueModel<?>[] models = new ModifiablePropertyValueModel<?>[COLUMN_COUNT];
 			models[NAME_COLUMN_INDEX]  = buildNameHolder(subject);
 			models[VALUE_COLUMN_INDEX] = buildValueHolder(subject);
 			return models;
@@ -315,7 +315,7 @@
 		protected void initializeMainComposite(Composite container,
 		                                       Adapter adapter,
 		                                       ListValueModel<?> listHolder,
-		                                       WritablePropertyValueModel<?> selectedItemHolder,
+		                                       ModifiablePropertyValueModel<?> selectedItemHolder,
 		                                       IBaseLabelProvider labelProvider,
 		                                       String helpId) {
 

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/TypeComposite.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/TypeComposite.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/TypeComposite.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -14,8 +14,8 @@
 import org.eclipse.jpt.common.ui.internal.widgets.Pane;
 import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
 import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
+import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
 import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
 import org.eclipse.swt.widgets.Composite;
 import org.jboss.tools.hibernate.jpt.core.internal.context.TypeConverter;
 
@@ -49,7 +49,7 @@
 		);
 	}
 
-	private WritablePropertyValueModel<String> buildTypeTypeHolder() {
+	private ModifiablePropertyValueModel<String> buildTypeTypeHolder() {
 		return new PropertyAspectAdapter<TypeConverter, String>(getSubjectHolder(), TypeConverter.TYPE_PROPERTY) {
 			@Override
 			protected String buildValue_() {

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/TypeDefPropertyComposite.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/TypeDefPropertyComposite.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/TypeDefPropertyComposite.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -18,8 +18,8 @@
 import org.eclipse.jpt.common.ui.internal.widgets.Pane;
 import org.eclipse.jpt.common.utility.internal.StringTools;
 import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
+import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
 import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
 import org.eclipse.swt.widgets.Composite;
 import org.jboss.tools.hibernate.jpt.core.internal.context.java.JavaTypeDef;
 
@@ -53,7 +53,7 @@
 		new ParametersComposite(this, container, getSubjectHolder());
 	}
 	
-	protected WritablePropertyValueModel<String> buildNameTextHolder() {
+	protected ModifiablePropertyValueModel<String> buildNameTextHolder() {
 		return new PropertyAspectAdapter<JavaTypeDef, String>(
 				getSubjectHolder(), JavaTypeDef.NAME_PROPERTY) {
 			@Override
@@ -78,7 +78,7 @@
 			private List<String> superInterfaces = Collections.singletonList(JavaTypeDef.USER_TYPE_INTERFACE);
 
 			@Override
-			protected WritablePropertyValueModel<String> buildTextHolder() {
+			protected ModifiablePropertyValueModel<String> buildTextHolder() {
 				return new PropertyAspectAdapter<JavaTypeDef, String>(getSubjectHolder(), JavaTypeDef.TYPE_CLASS_PROPERTY) {
 					@Override
 					protected String buildValue_() {
@@ -132,7 +132,7 @@
 		return new ClassChooserPane<JavaTypeDef>(this, container) {
 
 			@Override
-			protected WritablePropertyValueModel<String> buildTextHolder() {
+			protected ModifiablePropertyValueModel<String> buildTextHolder() {
 				return new PropertyAspectAdapter<JavaTypeDef, String>(getSubjectHolder(), JavaTypeDef.DEF_FOR_TYPE_PROPERTY) {
 					@Override
 					protected String buildValue_() {

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/TypeDefsComposite.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/TypeDefsComposite.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/TypeDefsComposite.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -29,8 +29,8 @@
 import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
 import org.eclipse.jpt.common.utility.internal.model.value.swing.ObjectListSelectionModel;
 import org.eclipse.jpt.common.utility.model.value.ListValueModel;
+import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
 import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
 import org.eclipse.osgi.util.NLS;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.layout.GridData;
@@ -49,7 +49,7 @@
 
 	private AddRemoveListPane<HibernateJavaTypeDefContainer> listPane;
 	Pane<? extends JavaTypeDef> typeDefPane;
-	private WritablePropertyValueModel<JavaTypeDef> typeDefHolder;
+	private ModifiablePropertyValueModel<JavaTypeDef> typeDefHolder;
 	private NewNameDialogBuilder dialogBuilder = null;
 
 	public TypeDefsComposite(
@@ -112,12 +112,12 @@
 		{
 			@Override
 			protected ListIterator<JavaTypeDef> listIterator_() {
-				return this.subject.typeDefs();
+				return this.subject.getTypeDefs().iterator();
 			}
 
 			@Override
 			protected int size_() {
-				return this.subject.typeDefsSize();
+				return this.subject.getTypeDefsSize();
 			}
 		};
 	}
@@ -162,7 +162,7 @@
 				String name = typeDef.getName();
 
 				if (name == null) {
-					int index = CollectionTools.indexOf(getSubject().typeDefs(), typeDef);
+					int index = CollectionTools.indexOf(getSubject().getTypeDefs(), typeDef);
 					name = NLS.bind(HibernateUIMappingMessages.TypeDefsComposite_displayString, Integer.valueOf(index));
 				}
 
@@ -171,7 +171,7 @@
 		};
 	}
 
-	private WritablePropertyValueModel<JavaTypeDef> buildTypeDefHolder() {
+	private ModifiablePropertyValueModel<JavaTypeDef> buildTypeDefHolder() {
 		return new SimplePropertyValueModel<JavaTypeDef>();
 	}
 
@@ -215,7 +215,7 @@
 		new ControlSwitcher(this.getTypeDefHolder(), this.buildPaneTransformer(), pageBook);
 	}
 	
-	protected WritablePropertyValueModel<JavaTypeDef> getTypeDefHolder() {
+	protected ModifiablePropertyValueModel<JavaTypeDef> getTypeDefHolder() {
 		return typeDefHolder;
 	}
 	

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/java/PackageInfoResourceUIDefinition.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/java/PackageInfoResourceUIDefinition.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/java/PackageInfoResourceUIDefinition.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -15,6 +15,7 @@
 import org.eclipse.jpt.common.core.JptCommonCorePlugin;
 import org.eclipse.jpt.common.core.JptResourceType;
 import org.eclipse.jpt.common.ui.WidgetFactory;
+import org.eclipse.jpt.common.ui.jface.ItemTreeStateProviderFactoryProvider;
 import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
 import org.eclipse.jpt.jpa.core.context.AttributeMapping;
 import org.eclipse.jpt.jpa.core.context.PersistentType;
@@ -25,7 +26,7 @@
 import org.eclipse.jpt.jpa.ui.details.DefaultMappingUiDefinition;
 import org.eclipse.jpt.jpa.ui.details.JpaComposite;
 import org.eclipse.jpt.jpa.ui.details.MappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.structure.JpaStructureProvider;
+import org.eclipse.jpt.jpa.ui.internal.persistence.details.PersistenceXmlUiDefinition;
 import org.eclipse.swt.widgets.Composite;
 
 /**
@@ -35,7 +36,7 @@
 public class PackageInfoResourceUIDefinition implements
 		MappingResourceUiDefinition {
 	
-	private static final JpaStructureProvider EMPTY = null;
+	private static final ItemTreeStateProviderFactoryProvider EMPTY = null;
 	
 	// singleton
 	private static final ResourceUiDefinition INSTANCE = new PackageInfoResourceUIDefinition();
@@ -62,11 +63,7 @@
 		return resourceType.equals(JptCommonCorePlugin.JAVA_SOURCE_PACKAGE_INFO_RESOURCE_TYPE);
 	}
 
-	/* (non-Javadoc)
-	 * @see org.eclipse.jpt.jpa.ui.ResourceUiDefinition#getStructureProvider()
-	 */
-	@Override
-	public JpaStructureProvider getStructureProvider() {
+	public ItemTreeStateProviderFactoryProvider getStructureViewFactoryProvider() {
 		return EMPTY;
 	}
 

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/orm/HibernateOrmXmlUiDefinition.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/orm/HibernateOrmXmlUiDefinition.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/orm/HibernateOrmXmlUiDefinition.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -13,6 +13,8 @@
 import java.util.List;
 
 import org.eclipse.jpt.common.core.JptResourceType;
+import org.eclipse.jpt.common.ui.internal.jface.SimpleItemTreeStateProviderFactoryProvider;
+import org.eclipse.jpt.common.ui.jface.ItemTreeStateProviderFactoryProvider;
 import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
 import org.eclipse.jpt.jpa.core.context.AttributeMapping;
 import org.eclipse.jpt.jpa.core.context.TypeMapping;
@@ -34,8 +36,8 @@
 import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmOneToOneMappingUiDefinition;
 import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmTransientMappingUiDefinition;
 import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmVersionMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.structure.OrmResourceModelStructureProvider;
-import org.eclipse.jpt.jpa.ui.structure.JpaStructureProvider;
+import org.eclipse.jpt.jpa.ui.internal.structure.OrmStructureItemContentProviderFactory;
+import org.eclipse.jpt.jpa.ui.internal.structure.OrmStructureItemLabelProviderFactory;
 
 
 /**
@@ -73,10 +75,16 @@
 		return resourceType.equals(JptJpaCorePlugin.ORM_XML_1_0_RESOURCE_TYPE);
 	}
 	
-	public JpaStructureProvider getStructureProvider() {
-		return OrmResourceModelStructureProvider.instance();
+	public ItemTreeStateProviderFactoryProvider getStructureViewFactoryProvider() {
+		return STRUCTURE_VIEW_FACTORY_PROVIDER;
 	}
 	
+	public static final ItemTreeStateProviderFactoryProvider STRUCTURE_VIEW_FACTORY_PROVIDER =
+			new SimpleItemTreeStateProviderFactoryProvider(
+					OrmStructureItemContentProviderFactory.instance(),
+					OrmStructureItemLabelProviderFactory.instance()
+				);
+	
 	@Override
 	protected void addOrmAttributeMappingUiDefinitionsTo(List<OrmAttributeMappingUiDefinition<? extends AttributeMapping>> definitions) {
 		definitions.add(OrmIdMappingUiDefinition.instance());

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/persistence/details/HibernatePersistenceUnitClassesComposite.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/persistence/details/HibernatePersistenceUnitClassesComposite.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/persistence/details/HibernatePersistenceUnitClassesComposite.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -31,11 +31,9 @@
 import org.eclipse.jpt.common.utility.internal.model.value.ListAspectAdapter;
 import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
 import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
 import org.eclipse.jpt.common.utility.internal.model.value.swing.ObjectListSelectionModel;
 import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
+import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
 import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
 import org.eclipse.jpt.jpa.core.context.persistence.ClassRef;
 import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
@@ -44,7 +42,6 @@
 import org.eclipse.jpt.jpa.ui.internal.JpaMappingImageHelper;
 import org.eclipse.jpt.jpa.ui.internal.JptUiIcons;
 import org.eclipse.jpt.jpa.ui.internal.persistence.JptUiPersistenceMessages;
-import org.eclipse.osgi.util.NLS;
 import org.eclipse.swt.graphics.Image;
 import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.widgets.Composite;
@@ -68,7 +65,6 @@
 	}
 
 	private void addMappedClass(ObjectListSelectionModel listSelectionModel) {
-
 		IType type = chooseType();
 
 		if (type != null) {
@@ -82,7 +78,7 @@
 	}
 	
 	private boolean classRefExists(String className) {
-		for ( ListIterator<ClassRef> i = getSubject().specifiedClassRefs(); i.hasNext(); ) {
+		for ( ListIterator<ClassRef> i = getSubject().getSpecifiedClassRefs().iterator(); i.hasNext(); ) {
 			ClassRef classRef = i.next();
 			if( classRef.getClassName().equals(className)) {
 				return true;
@@ -129,7 +125,7 @@
 		};
 	}
 
-	private WritablePropertyValueModel<Boolean> buildExcludeUnlistedMappedClassesHolder() {
+	private ModifiablePropertyValueModel<Boolean> buildExcludeUnlistedMappedClassesHolder() {
 		return new PropertyAspectAdapter<PersistenceUnit, Boolean>(
 			getSubjectHolder(),
 			PersistenceUnit.SPECIFIED_EXCLUDE_UNLISTED_CLASSES_PROPERTY)
@@ -196,17 +192,17 @@
 		return new ListAspectAdapter<PersistenceUnit, ClassRef>(getSubjectHolder(), PersistenceUnit.SPECIFIED_CLASS_REFS_LIST) {
 			@Override
 			protected ListIterator<ClassRef> listIterator_() {
-				return subject.specifiedClassRefs();
+				return subject.getSpecifiedClassRefs().iterator();
 			}
 
 			@Override
 			protected int size_() {
-				return subject.specifiedClassRefsSize();
+				return subject.getSpecifiedClassRefsSize();
 			}
 		};
 	}
 
-	private WritablePropertyValueModel<ClassRef> buildSelectedItemHolder() {
+	private ModifiablePropertyValueModel<ClassRef> buildSelectedItemHolder() {
 		return new SimplePropertyValueModel<ClassRef>();
 	}
 

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/persistence/details/HibernatePersistenceXmlUiDefinition.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/persistence/details/HibernatePersistenceXmlUiDefinition.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/persistence/details/HibernatePersistenceXmlUiDefinition.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -11,12 +11,12 @@
 package org.jboss.tools.hibernate.jpt.ui.internal.persistence.details;
 
 import org.eclipse.jpt.common.core.JptResourceType;
+import org.eclipse.jpt.common.ui.jface.ItemTreeStateProviderFactoryProvider;
 import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
 import org.eclipse.jpt.jpa.ui.ResourceUiDefinition;
 import org.eclipse.jpt.jpa.ui.internal.persistence.details.AbstractPersistenceXmlResourceUiDefinition;
+import org.eclipse.jpt.jpa.ui.internal.persistence.details.PersistenceXmlUiDefinition;
 import org.eclipse.jpt.jpa.ui.internal.persistence.details.PersistenceXmlUiFactory;
-import org.eclipse.jpt.jpa.ui.internal.structure.PersistenceResourceModelStructureProvider;
-import org.eclipse.jpt.jpa.ui.structure.JpaStructureProvider;
 
 /**
  * @author Dmitry Geraskov
@@ -53,7 +53,7 @@
 		return resourceType.equals(JptJpaCorePlugin.PERSISTENCE_XML_1_0_RESOURCE_TYPE);
 	}
 	
-	public JpaStructureProvider getStructureProvider() {
-		return PersistenceResourceModelStructureProvider.instance();
+	public ItemTreeStateProviderFactoryProvider getStructureViewFactoryProvider() {
+		return PersistenceXmlUiDefinition.STRUCTURE_VIEW_FACTORY_PROVIDER;
 	}
 }

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/persistence/details/HibernatePropertiesComposite.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/persistence/details/HibernatePropertiesComposite.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/persistence/details/HibernatePropertiesComposite.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -43,8 +43,8 @@
 import org.eclipse.jpt.common.utility.internal.model.value.SimpleListValueModel;
 import org.eclipse.jpt.common.utility.model.event.PropertyChangeEvent;
 import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
+import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
 import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
 import org.eclipse.jpt.jpa.ui.details.JpaPageComposite;
 import org.eclipse.swt.graphics.Image;
 import org.eclipse.swt.widgets.Button;
@@ -56,7 +56,7 @@
 import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
 import org.eclipse.ui.model.WorkbenchContentProvider;
 import org.eclipse.ui.model.WorkbenchLabelProvider;
-import org.eclipse.ui.views.navigator.ResourceSorter;
+import org.eclipse.ui.views.navigator.ResourceComparator;
 import org.hibernate.eclipse.console.FileFilter;
 import org.hibernate.eclipse.console.HibernateConsoleMessages;
 import org.hibernate.eclipse.console.utils.DriverClassHelpers;
@@ -114,9 +114,9 @@
 		}
 		final SimpleListValueModel<String> lvmUrl = new SimpleListValueModel<String>(urls);
 
-		WritablePropertyValueModel<String> dialectHolder = buildDialectHolder();
-		final WritablePropertyValueModel<String> driverHolder = buildDriverHolder();
-		final WritablePropertyValueModel<String> urlHolder = buildUrlHolder();
+		ModifiablePropertyValueModel<String> dialectHolder = buildDialectHolder();
+		final ModifiablePropertyValueModel<String> driverHolder = buildDriverHolder();
+		final ModifiablePropertyValueModel<String> urlHolder = buildUrlHolder();
 
 		Button b = addButton(section, HibernateConsoleMessages.CodeGenerationSettingsTab_setup, createSetupAction());
 		this.cfgFile = addLabeledText(section,
@@ -198,7 +198,6 @@
 	}
 
 	private IPath getConfigurationFilePath() {
-		BasicHibernateProperties props = getSubject();
 		String filePath = cfgFile.getText().trim();
 		IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
 		IFile[] files = root.findFilesForLocation(new Path(filePath));
@@ -321,7 +320,7 @@
 				dialog.setMessage(HibernateConsoleMessages.ConsoleConfigurationMainTab_choose_file_to_use_as_hibernate_cfg_xml);
 				dialog.addFilter(new FileFilter(new String[] {HibernateConsoleMessages.ConsoleConfigurationMainTab_cfg_xml}, null, true, false) );
 				dialog.setInput(root);
-				dialog.setSorter(new ResourceSorter(ResourceSorter.NAME) );
+				dialog.setComparator(new ResourceComparator(ResourceComparator.NAME));
 				dialog.setInitialSelection(focus);
 
 				if (dialog.open() == Window.OK) {
@@ -360,7 +359,7 @@
 		};
 	}
 
-	private WritablePropertyValueModel<String> buildConfigFileHolder() {
+	private ModifiablePropertyValueModel<String> buildConfigFileHolder() {
 		return new PropertyAspectAdapter<BasicHibernateProperties, String>(getSubjectHolder(),
 				BasicHibernateProperties.CONFIG_FILE_PROPERTY) {
 			@Override
@@ -376,7 +375,7 @@
 		};
 	}
 
-	private WritablePropertyValueModel<String> buildDialectHolder() {
+	private ModifiablePropertyValueModel<String> buildDialectHolder() {
 		return new PropertyAspectAdapter<BasicHibernateProperties, String>(getSubjectHolder(),
 				BasicHibernateProperties.DIALECT_PROPERTY) {
 			@Override
@@ -392,7 +391,7 @@
 		};
 	}
 
-	private WritablePropertyValueModel<String> buildDriverHolder() {
+	private ModifiablePropertyValueModel<String> buildDriverHolder() {
 		return new PropertyAspectAdapter<BasicHibernateProperties, String>(getSubjectHolder(),
 				BasicHibernateProperties.DRIVER_PROPERTY) {
 			@Override
@@ -408,7 +407,7 @@
 		};
 	}
 
-	private WritablePropertyValueModel<String> buildUrlHolder() {
+	private ModifiablePropertyValueModel<String> buildUrlHolder() {
 		return new PropertyAspectAdapter<BasicHibernateProperties, String>(getSubjectHolder(),
 				BasicHibernateProperties.URL_PROPERTY) {
 			@Override
@@ -424,7 +423,7 @@
 		};
 	}
 
-	private WritablePropertyValueModel<String> buildSchemaDefaultHolder() {
+	private ModifiablePropertyValueModel<String> buildSchemaDefaultHolder() {
 		return new PropertyAspectAdapter<BasicHibernateProperties, String>(getSubjectHolder(),
 				BasicHibernateProperties.SCHEMA_DEFAULT_PROPERTY) {
 			@Override
@@ -440,7 +439,7 @@
 		};
 	}
 
-	private WritablePropertyValueModel<String> buildCatalogDefaultHolder() {
+	private ModifiablePropertyValueModel<String> buildCatalogDefaultHolder() {
 		return new PropertyAspectAdapter<BasicHibernateProperties, String>(getSubjectHolder(),
 				BasicHibernateProperties.CATALOG_DEFAULT_PROPERTY) {
 			@Override
@@ -456,7 +455,7 @@
 		};
 	}
 
-	private WritablePropertyValueModel<String> buildUsernameHolder() {
+	private ModifiablePropertyValueModel<String> buildUsernameHolder() {
 		return new PropertyAspectAdapter<BasicHibernateProperties, String>(getSubjectHolder(),
 				BasicHibernateProperties.USERNAME_PROPERTY) {
 			@Override
@@ -470,15 +469,10 @@
 				this.subject.setUsername(value);
 			}
 
-			@Override
-			protected void propertyChanged() {
-				// TODO Auto-generated method stub
-				super.propertyChanged();
-			}
 		};
 	}
 
-	private WritablePropertyValueModel<String> buildPasswordHolder() {
+	private ModifiablePropertyValueModel<String> buildPasswordHolder() {
 		return new PropertyAspectAdapter<BasicHibernateProperties, String>(getSubjectHolder(),
 				BasicHibernateProperties.PASSWORD_PROPERTY) {
 			@Override

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/persistence/details/jpa2/HibernatePersistenceXml2_0UiDefinition.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/persistence/details/jpa2/HibernatePersistenceXml2_0UiDefinition.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/persistence/details/jpa2/HibernatePersistenceXml2_0UiDefinition.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -11,12 +11,12 @@
 package org.jboss.tools.hibernate.jpt.ui.internal.persistence.details.jpa2;
 
 import org.eclipse.jpt.common.core.JptResourceType;
+import org.eclipse.jpt.common.ui.jface.ItemTreeStateProviderFactoryProvider;
 import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
 import org.eclipse.jpt.jpa.ui.ResourceUiDefinition;
 import org.eclipse.jpt.jpa.ui.internal.persistence.details.AbstractPersistenceXmlResourceUiDefinition;
+import org.eclipse.jpt.jpa.ui.internal.persistence.details.PersistenceXmlUiDefinition;
 import org.eclipse.jpt.jpa.ui.internal.persistence.details.PersistenceXmlUiFactory;
-import org.eclipse.jpt.jpa.ui.internal.structure.PersistenceResourceModelStructureProvider;
-import org.eclipse.jpt.jpa.ui.structure.JpaStructureProvider;
 
 /**
  * @author Dmitry Geraskov
@@ -53,7 +53,7 @@
 		return resourceType.equals(JptJpaCorePlugin.PERSISTENCE_XML_2_0_RESOURCE_TYPE);
 	}
 	
-	public JpaStructureProvider getStructureProvider() {
-		return PersistenceResourceModelStructureProvider.instance();
+	public ItemTreeStateProviderFactoryProvider getStructureViewFactoryProvider() {
+		return PersistenceXmlUiDefinition.STRUCTURE_VIEW_FACTORY_PROVIDER;
 	}
 }

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/platform/HibernateJpa2_0PlatformUiFactory.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/platform/HibernateJpa2_0PlatformUiFactory.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/platform/HibernateJpa2_0PlatformUiFactory.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -12,7 +12,7 @@
 
 import org.eclipse.jpt.jpa.ui.JpaPlatformUi;
 import org.eclipse.jpt.jpa.ui.JpaPlatformUiFactory;
-import org.eclipse.jpt.jpa.ui.internal.platform.generic.GenericNavigatorProvider;
+import org.eclipse.jpt.jpa.ui.internal.platform.generic.GenericJpaPlatformUiFactory;
 import org.jboss.tools.hibernate.jpt.ui.internal.HibernateJpa2_0PlatformUiProvider;
 
 /**
@@ -27,7 +27,7 @@
 
 	public JpaPlatformUi buildJpaPlatformUi() {
 		return new HibernateJpaPlatformUi(
-			new GenericNavigatorProvider(),
+			GenericJpaPlatformUiFactory.NAVIGATOR_FACTORY_PROVIDER,
 			HibernateJpa2_0PlatformUiProvider.instance()
 		);
 	}

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/platform/HibernateJpaPlatformUi.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/platform/HibernateJpaPlatformUi.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/platform/HibernateJpaPlatformUi.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -20,10 +20,10 @@
 import org.eclipse.debug.core.ILaunchManager;
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.jpt.common.ui.jface.ItemTreeStateProviderFactoryProvider;
 import org.eclipse.jpt.jpa.core.JpaProject;
 import org.eclipse.jpt.jpa.ui.JpaPlatformUiProvider;
 import org.eclipse.jpt.jpa.ui.internal.platform.generic.GenericJpaPlatformUi;
-import org.eclipse.jpt.jpa.ui.navigator.JpaNavigatorProvider;
 import org.hibernate.eclipse.launch.HibernateLaunchConstants;
 import org.jboss.tools.hibernate.jpt.core.internal.HibernateJpaProject;
 import org.jboss.tools.hibernate.jpt.ui.HibernateJptUIPlugin;
@@ -42,7 +42,7 @@
 	public static final String full_exporter_id = HibernateLaunchConstants.ATTR_EXPORTERS + '.' + "hbmexporter"; //$NON-NLS-1$
 
 	public HibernateJpaPlatformUi(
-			JpaNavigatorProvider navigatorProvider, 
+			ItemTreeStateProviderFactoryProvider navigatorProvider, 
 			JpaPlatformUiProvider platformUiProvider) 
 	{
 		super(navigatorProvider, platformUiProvider);

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/platform/HibernateJpaPlatformUiFactory.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/platform/HibernateJpaPlatformUiFactory.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/platform/HibernateJpaPlatformUiFactory.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -12,7 +12,7 @@
 
 import org.eclipse.jpt.jpa.ui.JpaPlatformUi;
 import org.eclipse.jpt.jpa.ui.JpaPlatformUiFactory;
-import org.eclipse.jpt.jpa.ui.internal.platform.generic.GenericNavigatorProvider;
+import org.eclipse.jpt.jpa.ui.internal.platform.generic.GenericJpaPlatformUiFactory;
 import org.jboss.tools.hibernate.jpt.ui.internal.HibernateJpaPlatformUiProvider;
 
 /**
@@ -27,7 +27,7 @@
 
 	public JpaPlatformUi buildJpaPlatformUi() {
 		return new HibernateJpaPlatformUi(
-			new GenericNavigatorProvider(),
+			GenericJpaPlatformUiFactory.NAVIGATOR_FACTORY_PROVIDER,
 			HibernateJpaPlatformUiProvider.instance()
 		);
 	}

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/widgets/EnterNameDialog.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/widgets/EnterNameDialog.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/widgets/EnterNameDialog.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -15,7 +15,7 @@
 import org.eclipse.jpt.common.ui.internal.widgets.DialogPane;
 import org.eclipse.jpt.common.ui.internal.widgets.ValidatingDialog;
 import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
+import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
 import org.eclipse.swt.graphics.Image;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Shell;
@@ -126,7 +126,7 @@
 			super(EnterNameDialog.this.getSubjectHolder(), parent);
 		}
 
-		private WritablePropertyValueModel<String> buildNameHolder() {
+		private ModifiablePropertyValueModel<String> buildNameHolder() {
 			return new PropertyAspectAdapter<NameStateObject, String>(getSubjectHolder(), NameStateObject.NAME_PROPERTY) {
 				@Override
 				protected String buildValue_() {

Modified: trunk/hibernatetools/tests/org.jboss.tools.hibernate.jpt.core.test/src/org/jboss/tools/hibernate/jpt/core/test/HibernateJpaModelTests.java
===================================================================
--- trunk/hibernatetools/tests/org.jboss.tools.hibernate.jpt.core.test/src/org/jboss/tools/hibernate/jpt/core/test/HibernateJpaModelTests.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.jpt.core.test/src/org/jboss/tools/hibernate/jpt/core/test/HibernateJpaModelTests.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -71,10 +71,10 @@
 		assertNotNull(jpaProject);
 		JpaRootContextNode rootContextNode = jpaProject.getRootContextNode();
 		Persistence p = rootContextNode.getPersistenceXml().getPersistence();
-		assertTrue(p.persistenceUnits().hasNext());
-		assertTrue(p.persistenceUnits().next() instanceof HibernatePersistenceUnit);
-		HibernatePersistenceUnit hpu = (HibernatePersistenceUnit) p.persistenceUnits().next();
-		List<ClassRef> crs = CollectionTools.list(hpu.classRefs());
+		assertTrue(p.getPersistenceUnitsSize() > 0);
+		assertTrue(p.getPersistenceUnits().iterator().next() instanceof HibernatePersistenceUnit);
+		HibernatePersistenceUnit hpu = (HibernatePersistenceUnit) p.getPersistenceUnits().iterator().next();
+		List<ClassRef> crs = CollectionTools.list(hpu.getClassRefs());
 		assertTrue(crs.size() == 2);
 		if (crs.get(0).isFor("entity.ManyToMany1")){
 			checkManyToMany1(crs.get(0));
@@ -98,10 +98,10 @@
 		assertNotNull(jpaProject);
 		JpaRootContextNode rootContextNode = jpaProject.getRootContextNode();
 		Persistence p = rootContextNode.getPersistenceXml().getPersistence();
-		assertTrue(p.persistenceUnits().hasNext());
-		assertTrue(p.persistenceUnits().next() instanceof HibernatePersistenceUnit);
-		HibernatePersistenceUnit hpu = (HibernatePersistenceUnit) p.persistenceUnits().next();
-		List<ClassRef> crs = CollectionTools.list(hpu.classRefs());
+		assertTrue(p.getPersistenceUnits().iterator().hasNext());
+		assertTrue(p.getPersistenceUnits().iterator().next() instanceof HibernatePersistenceUnit);
+		HibernatePersistenceUnit hpu = (HibernatePersistenceUnit) p.getPersistenceUnits().iterator().next();
+		List<ClassRef> crs = CollectionTools.list(hpu.getClassRefs());
 		assertTrue(crs.size() == 2);
 		if (crs.get(0).isFor("entity.ManyToMany1")){
 			checkManyToManyNS1(crs.get(0));
@@ -121,7 +121,7 @@
 		HibernateJavaTable table = entity.getTable();
 		assertEquals("ManyToMany1", table.getDBTableName());
 
-		ArrayList<JavaPersistentAttribute> attrs = CollectionTools.list(javaPersistentType.attributes());
+		ArrayList<JavaPersistentAttribute> attrs = CollectionTools.list(javaPersistentType.getAttributes());
 		assertTrue(attrs.size() == 3);
 
 		//id
@@ -150,7 +150,7 @@
 		HibernateJavaTable table = entity.getTable();
 		assertEquals("ManyToMany22", table.getDBTableName());
 
-		ArrayList<JavaPersistentAttribute> attrs = CollectionTools.list(javaPersistentType.attributes());
+		ArrayList<JavaPersistentAttribute> attrs = CollectionTools.list(javaPersistentType.getAttributes());
 		assertTrue(attrs.size() == 3);
 		//id
 		assertTrue(attrs.get(0).getMapping() instanceof HibernateJavaIdMapping);
@@ -183,7 +183,7 @@
 		HibernateJavaTable table = entity.getTable();
 		assertEquals("ctn_ManyToMany1", table.getDBTableName());
 
-		ArrayList<JavaPersistentAttribute> attrs = CollectionTools.list(javaPersistentType.attributes());
+		ArrayList<JavaPersistentAttribute> attrs = CollectionTools.list(javaPersistentType.getAttributes());
 		assertTrue(attrs.size() == 3);
 
 		//id
@@ -212,7 +212,7 @@
 		HibernateJavaTable table = entity.getTable();
 		assertEquals("tn_ManyToMany22", table.getDBTableName());
 
-		ArrayList<JavaPersistentAttribute> attrs = CollectionTools.list(javaPersistentType.attributes());
+		ArrayList<JavaPersistentAttribute> attrs = CollectionTools.list(javaPersistentType.getAttributes());
 		assertTrue(attrs.size() == 3);
 		//id
 		assertTrue(attrs.get(0).getMapping() instanceof HibernateJavaIdMapping);

Modified: trunk/hibernatetools/tests/org.jboss.tools.hibernate.jpt.core.test/src/org/jboss/tools/hibernate/jpt/core/test/HibernateJpaOrmModelTests.java
===================================================================
--- trunk/hibernatetools/tests/org.jboss.tools.hibernate.jpt.core.test/src/org/jboss/tools/hibernate/jpt/core/test/HibernateJpaOrmModelTests.java	2012-06-21 11:45:59 UTC (rev 42139)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.jpt.core.test/src/org/jboss/tools/hibernate/jpt/core/test/HibernateJpaOrmModelTests.java	2012-06-21 12:05:03 UTC (rev 42140)
@@ -73,10 +73,10 @@
 		assertNotNull(jpaProject);
 		JpaRootContextNode rootContextNode = jpaProject.getRootContextNode();
 		Persistence p = rootContextNode.getPersistenceXml().getPersistence();
-		assertTrue(p.persistenceUnits().hasNext());
-		assertTrue(p.persistenceUnits().next() instanceof HibernatePersistenceUnit);
-		HibernatePersistenceUnit hpu = (HibernatePersistenceUnit) p.persistenceUnits().next();
-		List<MappingFileRef> mfrs = CollectionTools.list(hpu.mappingFileRefs());
+		assertTrue(p.getPersistenceUnits().iterator().hasNext());
+		assertTrue(p.getPersistenceUnits().iterator().next() instanceof HibernatePersistenceUnit);
+		HibernatePersistenceUnit hpu = (HibernatePersistenceUnit) p.getPersistenceUnits().iterator().next();
+		List<MappingFileRef> mfrs = CollectionTools.list(hpu.getMappingFileRefs());
 		assertTrue(mfrs.size() == 1);
 		assertTrue(mfrs.get(0).getMappingFile() instanceof GenericOrmXml);
 		GenericOrmXml orm = (GenericOrmXml)mfrs.get(0).getMappingFile();
@@ -99,10 +99,10 @@
 		assertNotNull(jpaProject);
 		JpaRootContextNode rootContextNode = jpaProject.getRootContextNode();
 		Persistence p = rootContextNode.getPersistenceXml().getPersistence();
-		assertTrue(p.persistenceUnits().hasNext());
-		assertTrue(p.persistenceUnits().next() instanceof HibernatePersistenceUnit);
-		HibernatePersistenceUnit hpu = (HibernatePersistenceUnit) p.persistenceUnits().next();
-		List<MappingFileRef> mfrs = CollectionTools.list(hpu.mappingFileRefs());
+		assertTrue(p.getPersistenceUnits().iterator().hasNext());
+		assertTrue(p.getPersistenceUnits().iterator().next() instanceof HibernatePersistenceUnit);
+		HibernatePersistenceUnit hpu = (HibernatePersistenceUnit) p.getPersistenceUnits().iterator().next();
+		List<MappingFileRef> mfrs = CollectionTools.list(hpu.getMappingFileRefs());
 		assertTrue(mfrs.size() == 1);
 		assertTrue(mfrs.get(0).getMappingFile() instanceof GenericOrmXml);
 		GenericOrmXml orm = (GenericOrmXml)mfrs.get(0).getMappingFile();
@@ -118,7 +118,7 @@
 		HibernateOrmTable table = entity.getTable();
 		assertEquals("ManyToMany1", table.getDBTableName());
 
-		ArrayList<OrmReadOnlyPersistentAttribute> attrs = CollectionTools.list(ormPersistentType.attributes());
+		ArrayList<OrmReadOnlyPersistentAttribute> attrs = CollectionTools.list(ormPersistentType.getAttributes());
 		assertTrue(attrs.size() == 3);
 
 		//id
@@ -147,7 +147,7 @@
 		HibernateOrmTable table = entity.getTable();
 		assertEquals("ManyToMany22", table.getDBTableName());
 
-		ArrayList<OrmReadOnlyPersistentAttribute> attrs = CollectionTools.list(ormPersistentType.attributes());
+		ArrayList<OrmReadOnlyPersistentAttribute> attrs = CollectionTools.list(ormPersistentType.getAttributes());
 		assertTrue(attrs.size() == 3);
 
 		//id
@@ -180,7 +180,7 @@
 		HibernateOrmTable table = entity.getTable();
 		assertEquals("ctn_ManyToMany1", table.getDBTableName());
 
-		ArrayList<OrmReadOnlyPersistentAttribute> attrs = CollectionTools.list(ormPersistentType.attributes());
+		ArrayList<OrmReadOnlyPersistentAttribute> attrs = CollectionTools.list(ormPersistentType.getAttributes());
 		assertTrue(attrs.size() == 3);
 
 		//id
@@ -209,7 +209,7 @@
 		HibernateOrmTable table = entity.getTable();
 		assertEquals("tn_ManyToMany22", table.getDBTableName());
 
-		ArrayList<OrmReadOnlyPersistentAttribute> attrs = CollectionTools.list(ormPersistentType.attributes());
+		ArrayList<OrmReadOnlyPersistentAttribute> attrs = CollectionTools.list(ormPersistentType.getAttributes());
 		assertTrue(attrs.size() == 3);
 
 		//id



More information about the jbosstools-commits mailing list