Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

New Help for Old Friends VII

Revision as of 15:42, 27 April 2012 by Brian.vosburgh.oracle.com (Talk | contribs) (JPA)

This page collects notes and pointers to changes coming up in the WTP 3.4 (Juno) release.

This page acts as a central "jumping off" point for those adopters of WTP that are moving up from a previous version of WTP. Most of this information may be already contained in various mailing lists and Bugzilla reports, but it is believed best to have a central place to get people started. Adopters: if you run into trouble or notice things that are not covered here, please update this page and/or let us know (such as by opening a bug, or sending a note to wtp-dev). Web Tools is a Platform and we strive to provide compatible API evolution with clear migration paths, instructions, etc.

One thing we have learned in the past is that some adopters do not move with us to every new release. Some early adopters went from 0.7 directly to 1.5, for example. Unfortunately, it is difficult to present the information in that way, covering multiple changes across multiple version ranges, so those types of migrations have to read about migrating to each version.

Note: as these notes develop and grow in number, they may occasionally be re-organized into categories, etc.


Common

  • org.eclipse.wst.common.uriresolver has been incremented to 1.2.0 because of new API added for bug 365243.

Java EE

  • The Java Facet can now be installed on more projects than before, specifically on projects also having the Static Web facet, with which it previously conflicted. Discussion can be found in bug 353775, including early configuration issues similar to those that may be encountered by adopters.

Dali

General

  • bug 319736 - provisional API changes throughout the model to switch Iterators to Iterable

JPA

  • While fixing bug 277017 provisional API was added for resolving a JDT IType for class names specified throughout the JPA model. This would only affect those who have their own implementation of the interfaces listed in the bug.
  • org.eclipse.jpt.jpa.core.JptJpaCorePlugin.getJpaProject(IProject) -> (JpaProject) iProject.getAdapter(JpaProject.class)
  • org.eclipse.jpt.common.utility.Command -> org.eclipse.jpt.common.utility.command.Command
  • org.eclipse.jpt.jpa.ui.navigator.JpaNavigatorProvider -> org.eclipse.jpt.common.ui.jface.ItemTreeStateProviderFactoryProvider

Java Resource Model (Provisional API)

The non-JPA specific interfaces for the Java resource model found in org.eclipse.jpt.jpa.core.resource.java have been moved to the org.eclipse.jpt.common.core plug-in in the org.eclipse.jpt.common.core.resource.java package.

Interfaces moved:

  • JavaResourceNode
  • JavaResourcePackage
  • JavaResourcePackageFragment
  • JavaResourcePackageFragmentRoot
  • JavaResourcePackageInfoCompilationUnit
  • JavaResourceClassFile
  • JavaResourceCompilationUnit
  • JavaResourceAnnotatedElement
  • Annotation
  • AnnotationDefinition
  • NestableAnnotation
  • NestableAnnotationDefinition

Renamed:

  • JavaResourcePersistentMember renamed-> JavaResourceMember
  • JavaResourcePersistentType renamed-> JavaResourceType
  • JavaResourcePersistentTypeCache renamed-> JavaResourceTypeCache
  • JavaResourcePersistentAttribute renamed-> JavaResourceAttribute

Added:

  • JavaResourceField extends JavaResourceAttribute
  • JavaResourceMethod extends JavaResourceAttribute
  • JavaResourceAbstractType - JavaResourceType now extends it
  • JavaResourceEnum extends JavaResourceAbstractType
  • JavaResourceEnumConstant - JavaResourceEnum.getEnumConstants()

Removed:

  • Annotation.storeOn(Map) and Annotation.restoreFrom(Map) were removed.
  • AnnotationContainer, ContainerAnnotation and all sub-interfaces: AssociationOverridesAnnotation, AttributeOverridesAnnotation, JoinColumnsAnnotation, MapKeyJoinColumns2_0Annotation, NamedNativeQueriesAnnotation, NamedQueriesAnnotation, PrimaryKeyJoinColumnsAnnotation, SecondaryTablesAnnotation.
    • We changed how "container" annotations are handled. Our NestableAnnotation implementations now build a CombinationIndexedDeclarationAnnotationAdapter to handle moving nestable annotations between stand-alone and nested. You can look at SourceNamedQueryAnnotation as an example.

Changes to JavaResourceAnnotationElement:

  • addAnnotation(int, String, String) changed to addAnnotation(int, String) : NestableAnnotation. We now use the NestableAnnotationDefintion to determine the container annotation name so this method now takes only an index and the nestable annotation name.
  • addStandAloneAnnotation(NestableAnnotation) - this has been removed, no longer needed
  • annotations(String nestableAnnotationName, String containerAnnotationName): Iterator<NestableAnnotation> replaced with getAnnotations(String nestableAnnotationName) : Iterable<NestableAnnotation>
  • annotationsSize() renamed to getAnnotationsSize()


Changes to org.eclipse.jpt.jpa.core.JpaAnnotationDefinitionProvider

  • Removed getTypeAnnotationDefinitions(), getTypeMappingAnnotationDefinitions(), getAttributeAnnotationDefinitions() , getPackageAnnotationDefinitions()
  • Added getAnnotationDefinitions() and getNestableAnnotationDefinitions().
  • A "nestable" annotation definition would include NamedQueryAnnotationDefinition and defines the nestable annotation as "NamedQuery", the container annotation as "NamedQueries" and the element name as "value"


JPA Java Context Model (Provisional API)

org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute.getResourcePersistentAttribute() - this has been renamed to getResourceAttribute() and now returns a JavaResourceAttribute which is the JavaResourceField or JavaResourceMethod that will be annotated. See JavaPersistentAttribute.getAccessor() : Accessor which is a new interface that holds either the JavaResourceField or the JavaResourceMethod getter/setter pair. This is more flexible and allows for more advanced validation on property access in JPA. It also allowed us to support JAXB where you can annotate either the getter or the setter.

JSDT

  • Fixing bug 375652 required a breaking change introducing 2 new methods to org.eclipse.wst.jsdt.debug.core.jsdi.VirtualMachine. As one method determines whether toggling enablement is supported by the VM, adopters may wish to return false and continue only supporting the previous ability to add and remove breakpoints until such time as they are able to implement the enablement functionality.

Reference

This document ONLY covers changes between WTP 3.4 and WTP 3.3. See also: New Help for Old Friends VI (3.3), New Help for Old Friends V (3.2), New Help for Old Friends IV (3.1), New Help for Old Friends III (3.0), New Help for Old Friends II (2.0), and the original New Help for Old Friends (1.5)

Back to the top