Database Reference
In-Depth Information
Figure 9.9. Friends-of-friends submodel
9.5.1. Annotated queries
It shouldn't surprise you that SDN provides an annotation ( @Query in this case) for the
purposes of identifying a query to be executed. This can be very helpful in cases where
you want to return a filtered list of entities, or perhaps a subset of information determined
at runtime. The annotation can be applied to a field on a node entity, or to methods in a
repository interface. When the field isaccessed onanodeentity,oramethod isinvoked on
a repository interface, the query is executed and results are returned.
Annotation on node entities
Let's start with how the @Query annotation can be applied to the User node entity to
define some queries involving the friends-of-friends scenario:
 
Search WWH ::




Custom Search