NB: This Java installation must be version 1.5. WTP requires Dali to execute on a 1.5 JVM. Installing and using a 1.5 JRE/JDK reduces the possibility of any errors slipping through (e.g. using classes or methods added in later versions of Java). The host platform can be run on a later version of Java; but the Dali plug-ins must be compiled against and capable of executing on Java 1.5. Each Dali project's build path and project-specific Java compiler settings ensure Dali is compiled with Java 1.5 compliance; but there must be a Java 1.5 installation present for the compiler to compile against the correct Java jars.

NB: The JPA Diagram Editor compiles against Java 1.5; but it requires a Java 1.6 Execution Environment. This is because its prerequisite Graphiti requires a Java 1.6 Execution Environment.

Entity Generation from Tables

Architecture diagram

Coming soon...

Dali Terminology

Resource Model: A resource model directly reflects a given resource (Java source or XML source). Dali currently maintains three resource models, including one for persistence.xml, the XML mapping file(s), and one for JPA Annotations. For XML resources(Mapping File or persistence.xml) this is a generated EMF model that uses the WTP translator framework to read/write the XML source. On the Java side it is a non-EMF object model that represents the JPA Annotations on the Java Types and Attributes.

Context Model: A context model represents only the non-resource related JPA metadata. Dali currently maintains three context models, including one for persistence.xml, the XML mapping file(s), and one for JPA Annotations. It pulls together the persistence.xml, XML Mapping File and Java resource models and uses common API. As and example, it gives context to the Java Annotations so that a JavaResourcePersistentType in the resource model with Entity, Table, SecondaryTable annotations on it becomes a PersistentType with an Entity TypeMapping in the context model. The context model interfaces are used by the Dali UI and adopters.

Persistent Type: Any Java Type that will be persisted.

Persistent Attribute: Any Java Attribute that will be persisted.

Mapping: A collection of related JPA metadata that consists of a persistence strategy for a given Type or Attribute.

Type Mapping: A specific way of persisting a Persistent Type, for example, Enity, Mapped Superclass, or Embeddable. All JPA metadata specified at the Type level will be contained by this Type Mapping.

Attribute Mapping: A specific way of persisting a Persistent Attribute, for example, Basic, ManyToOne, or OneToMany. All JPA metadata specified at the Attribute level will be contained by this Attribute Mapping.

Model usage examples

Traversing the Context model for JPA metadata

To access the JPA metadata for a type listed in the persistence.xml file:

Changing the Context model programatically

If you are changing the model outside the UI thread you will need to configure the JPA project to make modifications on the UI thread as necessary. See JpaProject#setThreadLocalModifySharedDocumentCommandExecutor(CommandExecutor).

Also note the model is "updated" asynchronously with every change. If you want these updates to happen synchronously, you will need to set the JPA project's "updater". See JpaProject#setUpdater(Updater). Note the comments in SynchronousJpaProjectUpdater.

org.eclipse.jpt.eclipselink.ui

org.eclipse.jpt.core.tests

Description: Contains a suite of headless JUnit tests for the core plug-in.

org.eclipse.jpt.utility.tests

Description: Contains a comprehensive set of tests for the Utility classes.

Major Integration points

JDT

The Dali Core makes extensive use of the JDT Core model and utilities for the purpose of reading and writing Java class metadata.

Code Completion

DTP

The Dali DB and DDL plug-ins make use of the data definition mode and the New Connection Wizard. The Datasource Explorer view is an integral part of the Dali Persistence Perspective.

WTP

Facets

EMF-XML Translator Framework

Platform

Project Explorer

Extension Mechanism

Dali's main extension mechanism is the JpaPlatform Interface and extension point.

This interface is to be implemented by a JPA vendor to provide extensions to the core JPA model. The core JPA model will provide functionality for JPA spec annotations in java, persistence.xml and (orm.xml) mapping files. The org.eclipse.jpt.core.genericPlatform extension supplies resource models for those file types. As another vendor option you will have to supply those resource models as well or different ones as necessary.

The extension designates a Platform ID, Label, Class (implemenation of JpaPlatform), and an option to set the platform as a "Default" platform.