[DATACMNS-47] Support Java-based Configuration of Repositories Created: 16/Jun/11  Updated: 26/Jan/14  Resolved: 12/Jul/12

Status: Closed
Project: Spring Data Commons
Component/s: Repositories
Affects Version/s: 1.0 Final
Fix Version/s: 1.4 M1

Type: New Feature Priority: Minor
Reporter: Brandon M. Assignee: Oliver Drotbohm
Resolution: Fixed Votes: 17
Labels: None
Remaining Estimate: 0d
Time Spent: Not Specified
Original Estimate: 0d

Issue Links:
depends on DATACMNS-103 Setup hybrid Spring 3.0.6 / 3.1 build Closed
is depended on by DATAGRAPH-266 Provide JavaConfig support Resolved
is depended on by DATAJPA-69 Repositories scanning using java-config Closed
is depended on by DATAMONGO-476 JavaConfig support for Mongo reposito... Closed
is depended on by SGF-102 Add support for JavaConfig for reposi... Closed
Reference URL: http://forum.springsource.org/showthreadQuery.php?108508-Java-Config-Support-for-Repository-Configuration&p=359537
Last updater: Deepak Vohra


Add RepositoryFactoryBuilder that would allow for easily configuring repositories using Spring's Java-based configuration. See forum reference for details.

Comment by Brandon M. [ 27/Jun/11 ]

Any updates or thoughts on viability of adding this support in near future?

Comment by Michael Andrews [ 11/Mar/12 ]

This is really the only thing missing for basic repository configuration to be fully in java. +1.

Comment by Michael Andrews [ 11/Mar/12 ]

E.g., Have the mongo:repositories, jpa:repositories (etc.) XML definitions - available in java - to be used in @Configuration classes.

Comment by Oliver Drotbohm [ 12/Mar/12 ]

Have a look at DATAJPA-69 for an example of what you can do right now already. Similar thing could be done for the MongoDB module. I recommend setting up a helper method to include the meat of the configuration so that the @Bean methods basically only contain a call to that method piping in the repo interface.

Comment by Oliver Drotbohm [ 11/Jul/12 ]

I've just published a first draft of the support into feature branches. The store specific implementations can be found in feature branches named after the ticket as listed above. To try out the feature refer to the library using JAVACONFIG-SNAPSHOT as version suffix (e.g. for Spring Data JPA - 1.2.0.JAVACONFIG-SNAPSHOT). The annotations are named @EnableJpaRepositories, @EnableMongoRepositories, @EnableNeo4jRepositories.

Comment by Oliver Drotbohm [ 18/Jul/12 ]

Merged support back into master branch. Feature is now available in plain BUILD-SNAPSHOT snapshot versions of the individual store modules.

Comment by Deepak Vohra [ 26/Jan/14 ]

Is support for @EnableCassandraRepositories also available?

Comment by Deepak Vohra [ 26/Jan/14 ]

Found @EnableCassandraRepositories is already available.

Generated at Thu Oct 01 13:19:57 UTC 2020 using Jira 8.5.4#805004-sha1:0444eab799707f9ad7b248d69f858774aadfd250.