Jpa stream example. The JPAstreamer library offers another solution.