integrate pagination to Entity pattern