本文整理了Java中org.mongodb.morphia.Datastore.findAndDelete()
方法的一些代码示例,展示了Datastore.findAndDelete()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Datastore.findAndDelete()
方法的具体详情如下:
包路径:org.mongodb.morphia.Datastore
类名称:Datastore
方法名:findAndDelete
[英]Deletes the given entities based on the query (first item only).
[中]根据查询删除给定的实体(仅第一项)。
代码示例来源:origin: de.mhus.lib/mhu-lib-persistence
public <T> T findAndDelete(Query<T> query) {
return datastore.findAndDelete(query);
}
代码示例来源:origin: protegeproject/webprotege
/**
* Delete a {@link WatchRecord}.
* @param watch The {@link WatchRecord} to be deleted.
*/
@Override
public void deleteWatchRecord(@Nonnull WatchRecord watch) {
Query<WatchRecord> query = datastore.createQuery(WatchRecord.class)
.field(PROJECT_ID).equal(watch.getProjectId())
.field(USER_ID).equal(watch.getUserId())
.field(ENTITY).equal(watch.getEntity())
.field(TYPE).equal(watch.getType());
datastore.findAndDelete(query);
}
内容来源于网络,如有侵权,请联系作者删除!