簡體   English   中英

在使用 GORM mongoDB 插件的 Grails 應用程序中配置 MongoDatastore 類的 bean 覆蓋的最佳方法是什么?

[英]What is the best way to configure a bean override of MongoDatastore class in a Grails application that use GORM mongoDB plugin?

在使用 GORM MongoDB 插件的標准 Grails 應用程序中,如果您使用新的類(用於添加一些自定義行為)覆蓋類 MongoDatastore,例如:

class MyMongoDatastore extends MongoDatastore{ 

      here the override methods and property

}

並且您想將其配置為由插件使用,最好的使用方法是什么?

resources.groovy定義要覆蓋的 bean 和要覆蓋的類:

beans = {
    mongoDatastore(MyMongoDatastore)
}

https://docs.grails.org/latest/guide/spring.html

我以前沒有使用過 mongo - 假設這些名字是正確的,給你的例子。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM