Skip to content

Latest commit

 

History

History
87 lines (53 loc) · 2.69 KB

stateful-relations.textile

File metadata and controls

87 lines (53 loc) · 2.69 KB
layout title
manual
Stateful Relations

Note: statefull relations are a beta feature, supported only as of version 0.9.4beta4

Declaring Stateful Relations

Stateful relations have the same methods as stateless ones, the main difference is that wherever you have a Query[A] in a stateless
becomes an Iterable[A] in a stateful relation.

Stateful relations are defined exactly the same way as their stateless counterpart, with the exception that the leftStateful and rightStateful methods are
invoke instead of left and right :

StatefulOneToMany and StatefulManyToOne

Methods in statefull relations are very similar than their stateless counterpart, their signatures are slightly different, and have a refresh method. Note the relation property, it is the stateless relation objects that provides the persistence related functionality. A stateful relation is in fact a wrapper over a stateless one, with caching.

StatefullManyToMany

The similarity between StatefulManyToMany and ManyToMany is also very apparent :