Spring Data Document

org.springframework.data.mongodb.repository
Annotation Type Query


@Retention(value=RUNTIME)
@Target(value=METHOD)
@Documented
public @interface Query

Annotation to declare finder queries directly on repository methods. Both attributes allow using a placeholder notation of ?0, ?1 and so on.

Author:
Oliver Gierke

Optional Element Summary
 String fields
          Defines the fields that should be returned for the given query.
 String value
          Takes a MongoDB JSON string to define the actual query to be executed.
 

value

public abstract String value
Takes a MongoDB JSON string to define the actual query to be executed. This one will take precendece over the method name then.

Returns:
Default:
""

fields

public abstract String fields
Defines the fields that should be returned for the given query. Note that only these fields will make it into the domain object returned.

Returns:
Default:
""

Spring Data Document

Copyright © 2012. All Rights Reserved.