From 8a2302ec48d1abebef3f855294df87c587908066 Mon Sep 17 00:00:00 2001 From: Oliver Gierke Date: Tue, 29 Mar 2011 20:04:31 +0200 Subject: [PATCH 1/2] DATADOC-59 - Polished JavaDoc of @Query annotation. --- .../document/mongodb/repository/Query.java | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/document/mongodb/repository/Query.java b/spring-data-mongodb/src/main/java/org/springframework/data/document/mongodb/repository/Query.java index 42326b172..82bd7b269 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/document/mongodb/repository/Query.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/document/mongodb/repository/Query.java @@ -17,10 +17,10 @@ package org.springframework.data.document.mongodb.repository; import java.lang.annotation.*; - /** - * Annotation to declare finder queries directly on repository methods. - * + * Annotation to declare finder queries directly on repository methods. Both attributes allow using a placeholder + * notation of {@code ?0}, {@code ?1} and so on. + * * @author Oliver Gierke */ @Retention(RetentionPolicy.RUNTIME) @@ -28,7 +28,19 @@ import java.lang.annotation.*; @Documented public @interface Query { + /** + * Takes a MongoDB JSON string to define the actual query to be executed. This one will take precendece over the + * method name then. + * + * @return + */ String value() default ""; + /** + * Defines the fields that should be returned for the given query. Note that only these fields will make it into the + * domain object returned. + * + * @return + */ String fields() default ""; } From 940823778e042fb3a88a06eced8f0e11e827b2af Mon Sep 17 00:00:00 2001 From: Oliver Gierke Date: Tue, 29 Mar 2011 20:37:22 +0200 Subject: [PATCH 2/2] Made MongoEntityInformation public as it's needed when extending SimpleRepositoryFactory. --- .../document/mongodb/repository/MongoEntityInformation.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/document/mongodb/repository/MongoEntityInformation.java b/spring-data-mongodb/src/main/java/org/springframework/data/document/mongodb/repository/MongoEntityInformation.java index 5d742e89c..061792af2 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/document/mongodb/repository/MongoEntityInformation.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/document/mongodb/repository/MongoEntityInformation.java @@ -24,7 +24,7 @@ import org.springframework.data.repository.support.EntityInformation; * * @author Oliver Gierke */ -interface MongoEntityInformation extends EntityInformation { +public interface MongoEntityInformation extends EntityInformation { /** * Returns the name of the collection the entity shall be persisted to.