Java Reference
In-Depth Information
maxResults) {
Query query = em.createQuery(jpqlStmt);
if (firstResult > 0) {
query = query.setFirstResult(firstResult);
}
if (maxResults > 0) {
query = query.setMaxResults(maxResults);
}
return query.getResultList();
}
/** <code>select o from Section o</code> */
public List<Section> findSectionsAll() {
return em.createNamedQuery("findSectionsAll").getResultList();
}
/** <code>select o from Section o</code> */
public List<Section> findSectionsAllByRange(int firstResult,
int maxResults) {
Query query = em.createNamedQuery("findSectionsAll");
if (firstResult > 0) {
query = query.setFirstResult(firstResult);
}
if (maxResults > 0) {
query = query.setMaxResults(maxResults);
}
return query.getResultList();
}
}
The remote interface for the session bean is listed as follows. If you are not using a
distributed environment, a local interface for the session bean may be used instead
of a remote interface.
package model;
import java.util.List;
import javax.ejb.Remote;
@Remote
public interface EJB3SessionEJB {
List<Edition> getAllEditions();
List<Section> getAllSections();
List<Article> getAllArticles();
Edition getEditionById(String id);
Section getSectionById(String id);
Article getArticleById(String id);
 
Search WWH ::




Custom Search