Skip to content

Latest commit

 

History

History
37 lines (29 loc) · 1.48 KB

File metadata and controls

37 lines (29 loc) · 1.48 KB

Many Ended Associations

In the previous section we discussed the implications of association proxies for single-ended associations. However, the same applies with many-ended associations.

In the case of collection types, these implement the RxPersistentCollection and again can be subscribed to:

Author author = Author.findByName("Steven King")
author.books.subscribe { Collection<Book> books ->
    for (Book book in books) {
        println "Book: ${book.title}"
    }
}

Like single-ended associations you can also use a join query to eagerly fetch the association and avoid having to subscribe to it in order to achieve a non-blocking outcome.