| <?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 0.5"> |
| <description> |
| <strong>To work with Java Persistence Entities you |
| need couple of prerequisites:</strong> |
| <ul> |
| <li>An installed 1.5 JRE</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://otn.oracle.com/jpa">Oracle</a>, |
| <a href="http://jboss.com/products/ejb3">JBoss</a>, or |
| <a href="http://www.bea.com/kodo/">BEA</a>. |
| The Java EE 5 reference implementation |
| <a href="https://glassfish.dev.java.net/"> |
| Glassfish</a> |
| also ships with the <a href="http://otn.oracle.com/jpa">TopLink |
| Essentials JPA Reference Implementation</a>.</li> |
| </ul> |
| <strong>To work with Java Persistence Entities you need |
| to enable persistence functionality in a Java project:</strong> |
| <ul> |
| <li>Make sure your Project's Java Compiler |
| Compliance Level is set to 5.0</li> |
| <li>Switch to the "Persistence Perspective"--you don't |
| have to but this perspective contains the views that support |
| entity editing.</li> |
| <li>Right-click on a Java Project and |
| choose <em>Java Persistence -> Add Java Persistence...</em> (see the |
| viewlet demo <a href="viewlets/01-Add_Persistence_viewlet_swf.html" target="_top"> |
| Adding Persistence to a Project</a>)</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>Right-click on your Java Project |
| and choose <em>New -> Other -> Java Persistence -> Entity</em></li> |
| <li>Or, you can create a new Java class |
| and simply add the "@Entity" annotation to it. The Dali tools |
| will pickup the change and the editing views will activate.</li> |
| </ul> |
| <strong>To make an existing POJO an Entity:</strong> |
| <ul> |
| <li>Right-click on your Class in the |
| Package Explorer and choose <em>Persistence -> Make Java Persistence |
| Entity</em></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="main.php">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://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">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>When starting a new workbench |
| session, it is currently necessary to re-connect to your database |
| if you are working on-line with the DB. This allows the |
| Dali plug-in to provide DB related mapping assistance and validation.</li> |
| </ul> |
| </description> |
| </section> |
| </sections> |