| <?xml version="1.0" encoding="UTF-8"?> |
| <sections title="Dali JPA Tools" |
| subtitle="An Eclipse Web Tools Platform Sub-Project"> |
| <section class="main" name="Getting Started with Dali"> |
| <description> |
| <strong>To work with Java Persistence Entities you |
| need couple of prerequisites:</strong> |
| <ul> |
| <li>An installed 1.5 JRE or higher</li> |
| <li>A Java EE 5 compliant runtime |
| or compliant Java Persistence API implementation. You can download a JPA implementation |
| from <a target="_blank" href="http://www.eclipse.org/eclipselink">Eclipse (EclipseLink)</a> or from a |
| number of other open source and commercial vendors.</li> |
| </ul> |
| <strong>To work with Java Persistence Entities you need |
| to create a JPA Project:</strong> |
| <ul> |
| <li>Make sure your Project's Java Compiler |
| Compliance Level is set to 5.0</li> |
| <li>Select File->New Project...JPA->JPA Project</li> |
| <li>Follow the instructions on the Wizard. |
| You'll need to identify the jar containing the JPA annotation |
| definitions so your entities will compile. You'll also need |
| to select, or define, a database connection that will be used |
| to access relational schema information.</li> |
| </ul> |
| <strong>To create a new persistent Entity:</strong> |
| <ul> |
| <li>Create a new Java Class and add this class to your persistence.xml file</li> |
| <li>In the JPA Details view, select to map the class as an Entity.</li> |
| <li>Or use the New Entity Wizard.</li> |
| </ul> |
| <strong>To make an existing POJO an Entity:</strong> |
| <ul> |
| <li>Open the persistence.xml file using the Persistence XML Editor. |
| Add the class to the Managed Classes list.</li> |
| <li>Or simply add the "@Entity" annotation |
| to any existing POJO class definition. The Dali tools will pickup |
| the change and the editing views will activate.</li> |
| </ul> |
| Take a look at the viewlet demos |
| on the <a href="/webtools/dali/">Dali Home Page</a> for a walk through |
| of building property access and field access Entities. |
| </description> |
| </section> |
| <section class="main" name="Running JPA Applications 'Out of Container'"> |
| <description> |
| How you run your JPA application in a compliant runtime |
| in a Java SE environment ('out of container') is vendor specific. |
| We'll add links to how-to's for any runtime we're told about. |
| Post to the Dali newsgroup or mailing list if you have a how-to |
| you'd like included. |
| <ul> |
| <li> <a href="https://wiki.eclipse.org/EclipseLink/Examples/JPA/OutsideContainer">EclipseLink |
| Java SE How-To</a></li> |
| <li> <a href="https://glassfish.dev.java.net/javaee5/persistence/entity-persistence-support.html">TopLink |
| Essentials Java SE How-To</a></li> |
| <li><a href="http://www.hibernate.org/hib_docs/entitymanager/reference/en/html_single/#architecture-javase">JBoss |
| Hibernate How-To</a></li> |
| </ul> |
| </description> |
| </section> |
| <section class="main" name="Notes"> |
| <description> |
| <ul> |
| <li>In order to compile JPA Entities, |
| it is a requirement that the appropriate jar(s) from a JPA |
| runtime are available on the project classpath. The |
| "Add Java Persistence..." wizard will help you add the required library |
| to your project classpath. You must have previously installed a |
| Java EE 5 or JPA persistence runtime implementation--one is |
| not distributed with Dali. If you are working inside of a WebTools |
| Enterprise Application Project, no classpath configuration is needed |
| as your classpath should already contain the appropriate jars from your |
| Server configuration, assuming the server supports EJB 3.0.</li> |
| <li>Currently Dali only supports one Persistence Unit and one Persistence XML file |
| per project. Other configurations can exist in a JPA project, but the |
| validation and defaults processing may not be correct when multiple |
| persistence units are used.</li> |
| </ul> |
| </description> |
| </section> |
| </sections> |