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

Difference between revisions of "Dali Developer Documentation"

Line 1: Line 1:
 
=Dali JPA Tools – Internal/External Developer Documentation=
 
=Dali JPA Tools – Internal/External Developer Documentation=
Last updated: June 6, 2006
+
Last updated: Aug 13, 2008
 
+
 
Archive
 
Archive
  
Line 8: Line 7:
 
==Major Features==
 
==Major Features==
  
===Persistence Outline===
+
===JPA Structure View===
 
*Contains the elements of an Entity
 
*Contains the elements of an Entity
 
*Visual representation
 
*Visual representation
*Allows navigation of Persistence Properties view
+
*Allows navigation of JPA Details view
  
===Persistence View===
+
===JPA Details View===
*Provides rich UI for editing of persistence related metadata
+
*Provides rich UI for the editing of persistence related metadata
*Unified editing for Java annotation and orm.xml (when supported)
+
*Unified editing for Java annotation and orm.xml
 
*Provides defaults values for JPA metadata
 
*Provides defaults values for JPA metadata
  
 
===Validation===
 
===Validation===
*Validation in the form of “Problems” are reported based on the state of the Entities in our model
+
*Validation in the form of “Problems” are reported based on the state of the Persistent Types (Entities, Mapped Superclass, Embeddable) in our model
  
 
===Entity Generation from Tables===
 
===Entity Generation from Tables===
*Generates spec compliant Entities from tables defined in the WST.RDB database definition model
+
*Generates spec compliant Entities from tables defined in the DTP database definition model
  
===Table Generation from Entities===
 
*Generates platform specific tables from Entities through the DDL generation capabilities of the WST.RDB component
 
 
   
 
   
  
 
==Architecture diagram==
 
==Architecture diagram==
  
[[Image:Dali05ArchitectureDiagram.jpg]]
+
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.
  
  
==Dali Plug-ins==
+
==Dali Plug-ins (out of date)==
  
===org.eclipse.dali.core===
+
===org.eclipse.jpt.core===
Description:  EMF Models and implementations for ORM and Packaging components
+
Description:  Resource model and Context model interfaces and implementations
  
 
Dependency on:
 
Dependency on:
Line 168: Line 170:
 
===JDT===
 
===JDT===
  
The Dali Core makes extensive use of the JDT Core model and utilities for the purpose of reading and writing java class metadata. Future integration with the JDT will include use of the APT for the purpose of annotation value completion and high level annotation validation.
+
*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
  
===WST.RDB===
+
===DTP===
  
The Dali DB and DDL plug-ins make use of the data definition model, the New Connection Wizard, and the DDL generation capabilities.  The Data Explorer view is an integral part of the Dali Persistence Perspective.
+
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
 +
*ArtifactEdit/ModelProvider
  
==Extension Points==
+
===Platform===
 +
*Project Explorer
 +
 
 +
 
 +
==Extension Points (Out of date)==
  
 
===Core Mapping Extension===
 
===Core Mapping Extension===
Line 237: Line 248:
 
</pre>
 
</pre>
  
==Future Extension points==
 
 
Extension points will need to be defined in all of the places that the JSR 220 Specification leaves undetermined behavior.  This includes areas where a default value is implementation specific, such as the Primary Key Generator Strategy. Extension points will also need to be defined for additional Entity configuration.  This would include adding additional capabilities to an Entity, resulting in a new proprietary Entity.
 
 
Extension points along with API’s will be determined as the project matures, and requirements are applied from Dali extenders.  Here is a list of other likely extension points:
 
  
*Entity Creation Wizard
 
*Persistence.xml properties
 
*Entity Generation
 
*DDL Generation
 
*Query Hints
 
  
 
==Statement on API==
 
==Statement on API==
  
API has not been defined for the 0.5 release of Dali. The API will be drawn out from additional use cases and requirements from extenders.
+
Provisional API is available as of the 2.0 release.

Revision as of 17:56, 13 August 2008

Dali JPA Tools – Internal/External Developer Documentation

Last updated: Aug 13, 2008 Archive

Major Features

JPA Structure View

  • Contains the elements of an Entity
  • Visual representation
  • Allows navigation of JPA Details view

JPA Details View

  • Provides rich UI for the editing of persistence related metadata
  • Unified editing for Java annotation and orm.xml
  • Provides defaults values for JPA metadata

Validation

  • Validation in the form of “Problems” are reported based on the state of the Persistent Types (Entities, Mapped Superclass, Embeddable) in our model

Entity Generation from Tables

  • Generates spec compliant Entities from tables defined in the DTP database definition model


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.


Dali Plug-ins (out of date)

org.eclipse.jpt.core

Description: Resource model and Context model interfaces and implementations

Dependency on:

  • eclipse.core
  • eclipse.emf
  • eclipse.dali.db
  • eclipse.dali.utility
  • eclipse.jdt.core
  • eclipse.jem.util
  • eclipse.wst.common.emf
  • eclipse.wst.common.environment
  • eclipse.wst.common.modulecore
  • eclipse.wst.sse.core
  • eclipse.wst.validation
  • eclipse.wst.xml

org.eclipse.dali.db

Description: wst.rdb wrapper model, serves as Dali’s interface to the wst.rdb model. Also provides UI extension of New Connection Wizard.

Dependency on:

  • eclipse.core
  • eclipse.jface
  • eclipse.dali.utility
  • eclipse.wst.rdb.server.ui
  • eclipse.wst.rdb.core
  • eclipse.wst.rdb.models.sql


org.eclipse.dali.db.ddl

Description: Responsible for DDL generation

Dependency on:

  • eclipse.dali.core
  • eclipse.dali.db
  • eclipse.dali.utility
  • eclipse.jdt.core
  • eclipse.ui
  • org.eclipse.wst.rdb.core
  • org.eclipse.wst.rdb.fe.ui
  • org.eclipse.wst.rdb.models.dbdefinition
  • org.eclipse.wst.rdb.models.sql


org.eclipse.dali.doc.user

Description: User docs and infopop for Dali

Dependency on:

  • org.eclipse.help
  • org.eclipse.ui.cheatsheets

org.eclipse.dali.edit

Description: EMF Edit layer; generated item providers for EMF Entity and Packaging models

Dependency on:

  • eclipse.dali.core
  • eclipse.emf.edit


org.eclipse.dali.gen

Description: Contains model and generator code for generating Entities from tables

Dependency on:

  • eclipse.core
  • eclipse.dali.db
  • eclipse.dali.utility
  • eclipse.jdt.core


org.eclipse.dali.ui

Description: Contains the actions, composites, data models, wizards, views, and perspective that make up the Dali UI.

Dependency on:

  • eclipse.dali.*
  • eclipse.debug.ui
  • org.eclipse.emf.edit.ui
  • org.eclipse.jdt.core
  • org.eclipse.jdt.launching
  • org.eclipse.jdt.ui
  • org.eclipse.jface.text
  • org.eclipse.search
  • org.eclipse.ui.console
  • org.eclipse.ui.forms
  • org.eclipse.ui.ide
  • org.eclipse.ui.workbench.texteditor
  • org.eclipse.wst.common.environment
  • org.eclipse.wst.common.frameworks.ui
  • org.eclipse.wst.common.modulecore
  • org.eclipse.wst.rdb.server.ui
  • org.eclipse.wst.sse.core
  • org.eclipse.wst.xml.ui


org.eclipse.dali.ui.binding

Description: EMF Binding framework; provides binding mechanism to streamline the linkage of UI controls to corresponding EMF model attributes. (This will likely transition to use the new JFace Data Binding Framework - http://wiki.eclipse.org/index.php/JFace_Data_Binding)

Dependency on:

  • eclipse.core
  • eclipse.dali.ui.selection
  • eclipse.emf.ecore.xml
  • eclipse.emf.edit.ui


org.eclipse.dali.ui.selection

Description: UI Selection Framework; provides a selection manager to listen for and coordinate selection events that the Dali UI is interested in. This plug-in is still undergoing a lot of refactoring.

Dependency on:

  • eclipse.core
  • eclipse.emf.ecore.xml
  • eclipse.ui
  • eclipse.ui.workbench.texteditor


org.eclipse.dali.utility

Description: A set of utility classes for the Dali plug-in. Contains a set of advanced iterators, plus utilities for dealing with Files, Strings, Collections, etc.

No Dependencies.


org.eclipse.dali.core.tests

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


org.eclipse.dali.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
  • ArtifactEdit/ModelProvider

Platform

  • Project Explorer


Extension Points (Out of date)

Core Mapping Extension

This mapping extension creates a way for Dali extenders to define additional mapping types beyond the JPA specification. This mapping extension is used internally to define the JPA mapping types in the core model. It also formalizes the necessary classes to define for extending the core types. For UI support, a corresponding extension in the UI must be defined.

Core Mapping Extension example:

<extension point="org.eclipse.dali.core.mappings">
  <mapping annotationName="ExtendedBasic"
    javaModelAdapter="packageName.JavaExtendedBasicMappingModelAdapter"
    key="extendedBasic"
    xmlModelAdapter="packageName.XMLExtendedBasicMappingModelAdapter"
    xmlTagName="p:extended-basic"/>
</extension>


Core Default Mapping Extension

This mapping extension allows an extender to redefine the default mapping for a simple attribute type.

Core Default Mapping Extension example:

<extension point="org.eclipse.dali.core.defaultMappings">
  <mappingannotationName="ExtendedBasic"
    javaDefaultModelAdapter="packageName.JavaExtendedBasicMappingModelAdapter"/>
</extension>


UI Mapping Extension

This mapping extension allows an extender to define a mapping type that will be available for selection in the UI. A corresponding Core Mapping Extension is required to add mapping support to the UI. After defining a UI Mapping extension, the defined mapping will be available for selection in the “Map As:” combo box in the persistence properties of a persistent attribute.

UI Mapping Extension example:

<extension point="org.eclipse.dali.ui.mappings">
  <mapping annotationName="ExtendedBasic"
    compositeClassBuilder="packageName.ExtendedBasicMappingComposite$ExtendedBasicMappingCompositeBuilder"
    javaModelAdapter="packageName.JavaExendedBasicMappingModelAdapter"
    key="extendedBasic"
    label="%extendedBasicMapping"
    xmlModelAdapter="package.XMLExtendedBasicMappingModelAdapter"
    xmlTagName="p:extended-basic"/>
</extension>


UI Default Mapping Extension

This extension is used to redefine the Default mapping for the UI. It should correspond with the default Mapping extension defined in the Core Default Mapping extension.

<extensionpoint="org.eclipse.dali.ui.defaultMappings">
  <mapping
    annotationName="ExtendedBasic"
    compositeClassBuilder="packageName.ExtendedBasicMappingComposite$ExtendedBasicMappingCompositeBuilder"
    javaModelAdapter="packageName.JavaExtendedBasicMappingModelAdapter"
    key="extendedBasic"
    label="%defaultMapping"/>
</extension>


Statement on API

Provisional API is available as of the 2.0 release.

Back to the top