Java Reference
In-Depth Information
The generated Facade classes are deployed as RESTful web services and can be
accessed as such:
The AbstractFacade class serves as a parent class for all other Facade classes:
package com.ensode.netbeansbook.jaxrs.service;
import java.util.List;
import javax.persistence.EntityManager;
public abstract class AbstractFacade<T> {
private Class<T> entityClass;
public AbstractFacade(Class<T> entityClass) {
this.entityClass = entityClass;
protected abstract EntityManager getEntityManager();
public void create(T entity) {
public void edit(T entity) {
public void remove(T entity) {
public T find(Object id) {
return getEntityManager().find(entityClass, id);
public List<T> findAll() {
javax.persistence.criteria.CriteriaQuery cq =
Search WWH ::

Custom Search