To work with Java Persistence Entities you
need couple of prerequisites:
To work with Java Persistence Entities you need
to enable persistence functionality in a Java project:
- Make sure your Project's Java Compiler
Compliance Level is set to 5.0
- Switch to the "Persistence Perspective"--you don't
have to but this perspective contains the views that support
- Right-click on a Java Project and
choose Java Persistence -> Add Java Persistence... (see the
viewlet demo Adding Persistence
to a 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 create a new persistent Entity:
To make an existing POJO an Entity:
- Right-click on your Java Project
and choose New -> Other -> Java Persistence -> Entity
- 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.
- Right-click on your Class in the
Package Explorer and choose Persistence -> Make Java Persistence
- 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.