Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- val stream Stream[Record] = expression.stream().iterator().asScala.toStream
- stream.map(println(_))
- expression.stream().forEach(println);
- def allRecords():Stream[Record] = {
- val cur = expression.fetchLazy()
- def inner(): Stream[Record] = {
- if(cur.hasNext) {
- val next = cur.fetchOne
- next #:: inner()
- }
- else
- Stream.empty
- }
- inner()
- }
Add Comment
Please, Sign In to add comment