org.ektorp.docref
Annotation Type DocumentReferences


@Target(value=FIELD)
@Retention(value=RUNTIME)
public @interface DocumentReferences

Follow references to other documents when loading and updating this collection based on the result of a view query. The parameter view defines the name of a view located in the design document of the class or in the design document specified by designDoc. The parameter fetch controls when reference loading is performed. This annotation only has meaning on collection class members.

Author:
ragnar rova

Optional Element Summary
 String backReference
          The name of the back referring field in the child must be specified here.
 CascadeType[] cascade
          Set the type if cascade behaviour this collection should have.
 boolean descendingSortOrder
          Defines the sort direction of the loaded collection.
 String designDoc
          Design document of the view specified by view
 FetchType fetch
          Controls when referenced documents are loaded.
 String orderBy
          The sort order of the loaded collection can be specified by this parameter.
 String view
          If view is left unspecified a view will be generated for this document reference (given the persistent type is managed by a repository class based on org.ektorp.support.CouchDbRepositorySupport).
 

fetch

public abstract FetchType fetch
Controls when referenced documents are loaded. Default is LAZY and implies that references should be loaded when a method on the collection is accessed which needs the documents. EAGER means that all references of arbitrary depth will be followed directly at load time.

Default:
org.ektorp.docref.FetchType.LAZY

view

public abstract String view
If view is left unspecified a view will be generated for this document reference (given the persistent type is managed by a repository class based on org.ektorp.support.CouchDbRepositorySupport). View name for backward references. Backward references are stored in the documents on the other side of the reference. References are loaded into this collection by performing a view query against the specified view with the document id of the declaring class.

Default:
""

designDoc

public abstract String designDoc
Design document of the view specified by view

Default:
""

descendingSortOrder

public abstract boolean descendingSortOrder
Defines the sort direction of the loaded collection.

Default:
false

orderBy

public abstract String orderBy
The sort order of the loaded collection can be specified by this parameter. This parameter will refer to a field in the child docs. Note: This parameter is only applied if view is not specified.

Default:
""

backReference

public abstract String backReference
The name of the back referring field in the child must be specified here. Note: This parameter is only applied if view is not specified.

Default:
""

cascade

public abstract CascadeType[] cascade
Set the type if cascade behaviour this collection should have.

Returns:
Default:
org.ektorp.docref.CascadeType.NONE


Copyright © 2011. All Rights Reserved.