Getting Started with Dali
To work with Java Persistence Entities you
need couple of prerequisites:
To work with Java Persistence Entities you need
to create a JPA Project:
- An installed 1.5 JRE or higher
- A Java EE 5 compliant runtime
or compliant Java Persistence API implementation. You can download a JPA implementation
from Eclipse (EclipseLink) or from a
number of other open source and commercial vendors.
To create a new persistent Entity:
- Make sure your Project's Java Compiler
Compliance Level is set to 5.0
- Select File->New Project...JPA->JPA Project
- 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.
To make an existing POJO an Entity:
- Create a new Java Class and add this class to your persistence.xml file
- In the JPA Details view, select to map the class as an Entity.
- Or use the New Entity Wizard.
- Open the persistence.xml file using the Persistence XML Editor.
Add the class to the Managed Classes list.
- 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.
Take a look at the viewlet demos
on the Dali Home Page
for a walk through
of building property access and field access Entities.