Java Reference
In-Depth Information
Select the EJB3Model project node and select Tools | Project Properties . Select the
Libraries and Classpath node. The EJB 3.0 library should be in the classpath.
The Entity classes
Next, we shall construct the entity beans created; we shall add the required
NamedQueries and EJB 3.0 entity relationship mappings.
The Catalog entity class
The Catalog entity bean has properties id and journal , as shown below:
private int id;
private String journal;
In the Catalog entity add NamedQueries findCatalogAll() , which selects all the
Catalog entity instances and findCatalogByJournal() , which selects a Catalog
entity by journal name.
@NamedQuery(name="findCatalogAll", query="SELECT c FROM Catalog c"),
query="SELECT c FROM Catalog c
WHERE c.journal = :journal")
Search WWH ::

Custom Search