Created
July 20, 2013 10:11
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package kr.hconnect.mongo.test.music; | |
import com.mongodb.Mongo; | |
import com.mongodb.MongoClient; | |
import kr.hconnect.mongo.test.music.model.AlbumRepository; | |
import org.springframework.context.annotation.Configuration; | |
import org.springframework.data.mongodb.config.AbstractMongoConfiguration; | |
import org.springframework.data.mongodb.repository.config.EnableMongoRepositories; | |
import org.springframework.transaction.annotation.EnableTransactionManagement; | |
/** | |
* kr.hconnect.mongo.test.music.MongoConfiguration | |
* | |
* @author 배성혁 sunghyouk.bae@gmail.com | |
* @since 13. 7. 20. 오후 4:34 | |
*/ | |
@Configuration | |
@EnableTransactionManagement(proxyTargetClass = true) | |
/** 이게 있어야 Repository 의 Concrete Class를 생성해줍니다.*/ | |
@EnableMongoRepositories(basePackageClasses = { AlbumRepository.class }, repositoryImplementationPostfix = "Impl") | |
//@ComponentScan(basePackageClasses = { AlbumRepository.class }) | |
public class MongoConfiguration extends AbstractMongoConfiguration { | |
@Override | |
protected String getDatabaseName() { | |
return "musicDB"; | |
} | |
@Override | |
public Mongo mongo() throws Exception { | |
return new MongoClient("localhost"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment