Java Reference
In-Depth Information
Coding queries for your application
As you can see from the earlier code, the producer classes make use of beans named
SeatDao and SeatTypeDao to fill their collections of data. These beans perform some
simple finds on the Seat and SeatType objects, as shown in the following code:
public class SeatDao extends AbstractDao<Seat> {
public SeatDao() {
public class SeatTypeDao extends AbstractDao<SeatType> {
public SeatTypeDao() {
public abstract class AbstractDao<T extends Serializable>
implements Serializable {
private final Class<T> clazz;
private EntityManager em;
public AbstractDao(Class<T> clazz) {
this.clazz = clazz;
public T find(Object id) {
return em.find(clazz, id);
Search WWH ::

Custom Search