1.增加删除前监听事件 2.修改关键字key为id
This commit is contained in:
@@ -57,8 +57,8 @@ open class MongoQuery(var template: MongoTemplate, var logger: ILogger? = null)
|
||||
return result
|
||||
}
|
||||
|
||||
override fun <TView, TKey> get(key: TKey, clazz: Class<TView>): TView? {
|
||||
return this.template.findOne(whereId(key), clazz, this.collection(clazz))
|
||||
override fun <TView, TKey> get(id: TKey, clazz: Class<TView>): TView? {
|
||||
return this.template.findOne(whereId(id), clazz, this.collection(clazz))
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -110,10 +110,10 @@ open class MongoSpecificQuery<TView>(
|
||||
} else Page(1, 10)
|
||||
}
|
||||
|
||||
override fun get(key: String): TView? {
|
||||
override fun get(id: String): TView? {
|
||||
this.check()
|
||||
return if (this.clazz != null) {
|
||||
val view = this.template.findOne(whereId(key), this.clazz!!, this.collection)
|
||||
val view = this.template.findOne(whereId(id), this.clazz!!, this.collection)
|
||||
view
|
||||
} else null
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user