Class JPALazyDataModel<TT,KK>

Type Parameters:
TT - Data Type
KK - Key Type
All Implemented Interfaces:
Serializable, Iterable<TT>, SelectableDataModel<TT>

@Dependent @InternalQualifierJPALazyModel public class JPALazyDataModel<TT,KK> extends LazyDataModel<TT>
Easy implementation of PrimeFaces lazy data model using Lambdas, This is the main class in com.flowlogix.jeedao.primefaces package

An instance of this class is to be put into your ViewScoped or SessionScoped beans The implementation is serializable and works with failover to a different server instances

Simple Example:

userviewer.xhtml:

<p:dataTable lazy="true" value="#{userViewer.lazyModel}" var="user">
    ... specify columns as usual ...
</p:dataTable>
@Named
@ViewScoped
public class UserViewer implements Serializable {
    @Inject
    @Getter
    JPALazyDataModel<UserEntity, Long> lazyModel;
}

Direct Creation Example:

@Named
@ViewScoped
public class UserViewer implements Serializable {
    private final @Getter JPALazyDataModel<UserEntity, Long> userModel =
            JPALazyDataModel.create(builder -> builder.entityClass(UserEntity.class).build());
}
Author:
lprimak
See Also: