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, as
shown in the following code:
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) {
getEntityManager().persist(entity);
}
public void edit(T entity) {
getEntityManager().merge(entity);
}
 
Search WWH ::




Custom Search