I use Primafaces DataTable with scrolling pagination. I did everything, but the trouble loads very slowly ... From one page to another in 5 seconds even more there are only 20 records. I don’t know the reason for that
Here is my Bean
@Named(value = "maximaBean") @ViewScoped public class MaximaBean implements Serializable{ private List<Maxima> maximes = null; public List<Maxima> getMaximes() { MaximaDAO maximaDAO=new MaximaDAO(); maximes=maximaDAO.getMaximes(); return maximes; } } My DaoCLass
public class MaximaDAO { private Session session = null; private List<Maxima> maximes=null; public List<Maxima> getMaximes() { session=HibernateUtil.getSessionFactory() .getCurrentSession(); Transaction tx = session.beginTransaction(); Query q = session.createQuery("From Maxima as maxima"); maximes=(List<Maxima>)q.list(); tx.commit(); tx=null; return maximes; } } and my xhtml
<p:panel header="Example again" style="margin-bottom: 20px"> <h:form> <p:dataTable value="#{maximaBean.maximes}" var="maxim" rows="5" paginator="true" paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}" rowsPerPageTemplate="3,5,8"> <p:column headerText="Id"> <h:outputText value="#{maxim.id}"></h:outputText> </p:column> </p:dataTable> </h:form> </p:panel> Already since yesterday I have been trying, the main thing in YouTube is that the boy has done everything for him and it doesn’t work for me