Search code examples
eclipsedali

Dali JPT changes in eclipse 4.4


I have some eclipse plugins using old Dali JPT code( org.eclipse.jpt.core_2.2.1) running fine in eclipse 3.5 but I need to migrate them in eclipse 4.4. I can see there were significant changes in Dali JPT plugins, for example old org.eclipse.jpt.core.JptCorePlugin is completely removed. For example if I want to use some of its static methods like JptCorePlugin.getJpaFile(..) how shall I do it in the new version( org.eclipse.jpt.jpa.core_3.4.0 ). I have no previous experience using it so any info,hints or directions will be greatly appreciated.

Thank you


Solution

  • Much of the JptCorePlugin behavior was moved to the appropriate model objects, namely JpaPlatform and JpaProject. You can find documentation on these changes here:

    https://wiki.eclipse.org/New_Help_for_Old_Friends_VII#Dali

    and additional information on how to use these object here:

    https://wiki.eclipse.org/Dali_Developer_Documentation#Model

    Instead of using the static methods on JptCorePlugin, you would instead do something like:

    IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject("Foo Project");
    JpaProject jpaProject = (JpaProject) project.getAdapter(JpaProject.class);
    jpaProject.getJpaFile(...);