jpa查询所有的记录

来源:互联网 发布:网络布线好学吗 编辑:程序博客网 时间:2024/05/24 06:42
public interface JpaSpecificationExecutor<T> {    /**     * Returns a single entity matching the given {@link Specification}.     *     * @param spec     * @return     */    T findOne(Specification<T> spec);    /**     * Returns all entities matching the given {@link Specification}.     *     * @param spec     * @return     */    List<T> findAll(Specification<T> spec);    /**     * Returns a {@link Page} of entities matching the given {@link Specification}.     *     * @param spec     * @param pageable     * @return     */    Page<T> findAll(Specification<T> spec, Pageable pageable);    /**     * Returns all entities matching the given {@link Specification} and {@link Sort}.     *     * @param spec     * @param sort     * @return     */    List<T> findAll(Specification<T> spec, Sort sort);    /**     * Returns the number of instances that the given {@link Specification} will return.     *     * @param spec the {@link Specification} to count instances for     * @return the number of instances     */    long count(Specification<T> spec);}



1 0