public void testModifySpecifiedSchema() throws Exception { createTestEntityWithElementCollection(); addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributes().iterator().next().getMapping(); CollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable(); JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, AstNodeType.TYPE); JavaResourceField resourceField = resourceType.getFields().iterator().next(); CollectionTableAnnotation2_0 resourceCollectionTable = (CollectionTableAnnotation2_0) resourceField.getAnnotation(CollectionTableAnnotation2_0.ANNOTATION_NAME); assertNull(collectionTable.getSpecifiedSchema()); assertNull(resourceCollectionTable); // set schema in the context model, verify resource model modified collectionTable.setSpecifiedSchema("foo"); resourceCollectionTable = (CollectionTableAnnotation2_0) resourceField.getAnnotation(CollectionTableAnnotation2_0.ANNOTATION_NAME); assertEquals("foo", collectionTable.getSpecifiedSchema()); assertEquals("foo", resourceCollectionTable.getSchema()); // set schema to null in the context model collectionTable.setSpecifiedSchema(null); assertNull(collectionTable.getSpecifiedSchema()); assertNull(resourceField.getAnnotation(CollectionTableAnnotation2_0.ANNOTATION_NAME)); }