Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
   * Copyright 2012 the original author or authors.
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
 import  org.springframework.beans.factory.FactoryBean;
 import  org.springframework.context.annotation.ComponentScan.Filter;
 import  org.springframework.context.annotation.Import;
Annotation to activate MongoDB repositories. If no base package is configured through either value(), basePackages() or basePackageClasses() it will trigger scanning of the package of annotated class.

Oliver Gierke
Thomas Darimont
 public @interface EnableMongoRepositories {

Alias for the basePackages() attribute. Allows for more concise annotation declarations e.g.: @EnableJpaRepositories("") instead of @EnableJpaRepositories(basePackages="").
 	String[] value() default {};

Base packages to scan for annotated components. value() is an alias for (and mutually exclusive with) this attribute. Use basePackageClasses() for a type-safe alternative to String-based package names.
 	String[] basePackages() default {};

Type-safe alternative to basePackages() for specifying the packages to scan for annotated components. The package of each class specified will be scanned. Consider creating a special no-op marker class or interface in each package that serves no purpose other than being referenced by this attribute.
 	Class<?>[] basePackageClasses() default {};

Specifies which types are eligible for component scanning. Further narrows the set of candidate components from everything in basePackages() to everything in the base packages that matches the given filter or filters.
 	Filter[] includeFilters() default {};

Specifies which types are not eligible for component scanning.
 	Filter[] excludeFilters() default {};

Returns the postfix to be used when looking up custom repository implementations. Defaults to Impl. So for a repository named PersonRepository the corresponding implementation class will be looked up scanning for PersonRepositoryImpl.

 	String repositoryImplementationPostfix() default "Impl";

Configures the location of where to find the Spring Data named queries properties file. Will default to META-INFO/

 	String namedQueriesLocation() default "";

Returns the key of the QueryLookupStrategy to be used for lookup queries for query methods. Defaults to Key.CREATE_IF_NOT_FOUND.

Returns the FactoryBean class to be used for each repository instance. Defaults to MongoRepositoryFactoryBean.

Configures the name of the MongoTemplate bean to be used with the repositories detected.

	String mongoTemplateRef() default "mongoTemplate";

Whether to automatically create indexes for query methods defined in the repository interface.

	boolean createIndexesForQueryMethods() default false;

Configures whether nested repository-interfaces (e.g. defined as inner classes) should be discovered by the repositories infrastructure.
	boolean considerNestedRepositories() default false;
New to GrepCode? Check out our FAQ X