public < T > Page < T > findAll ( Pageable pageable , Class < T > entityClass , String privilegeKey ) { String selectSql = format ( SELECT_ALL_SQL , entityClass . getSimpleName ( ) ) ; String countSql = format ( COUNT_ALL_SQL , entityClass . getSimpleName ( ) ) ; String permittedCondition = createPermissionCondition ( privilegeKey ) ; if ( StringUtils . isNotBlank ( permittedCondition ) ) { selectSql += WHERE_SQL + permittedCondition ; countSql += WHERE_SQL + permittedCondition ; } log . debug ( "Executing SQL '{}'" , selectSql ) ; return execute ( createCountQuery ( countSql ) , pageable , createSelectQuery ( selectSql , pageable , entityClass ) ) ; }
Find all pageable permitted entities .