本文整理了Java中org.mongodb.morphia.Datastore.delete()
方法的一些代码示例,展示了Datastore.delete()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Datastore.delete()
方法的具体详情如下:
包路径:org.mongodb.morphia.Datastore
类名称:Datastore
方法名:delete
[英]Deletes the given entities (by id)
[中]删除给定的实体(按id)
代码示例来源:origin: lmco/streamflow
@Override
public void delete(T entity) {
if (entity != null) {
datastore.delete(entity);
}
}
代码示例来源:origin: lmco/streamflow
@Override
public void deleteById(ID id) {
datastore.delete(persistentClass, id);
}
代码示例来源:origin: acmeair/acmeair
@Override
public void cancelBooking(String user, String bookingId) {
try{
datastore.delete(BookingImpl.class, bookingId);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
代码示例来源:origin: protegeproject/webprotege
@Override
public void dropApiKeys(@Nonnull UserId userId) {
datastore.delete(UserApiKeys.class, userId);
}
代码示例来源:origin: getheimdall/heimdall
@Override
public <T> Boolean delete(T object) {
this.datastore().delete(object);
return true;
}
代码示例来源:origin: getheimdall/heimdall
@Override
public <T> Boolean delete(T object) {
this.datastore().delete(object);
return true;
}
代码示例来源:origin: protegeproject/webprotege
@Override
public void clearProjectWebhooks(ProjectId projectId) {
Query<ProjectWebhook> query = queryByProjectId(projectId);
datastore.delete(query);
}
代码示例来源:origin: de.mhus.lib/mhu-lib-persistence
public void delete(Object obj) {
datastore.delete(obj);
if (obj instanceof DbComfortableObject)
((DbComfortableObject)obj).doInit(null, null, false);
}
代码示例来源:origin: protegeproject/webprotege
@Override
public void save(@Nonnull EntityTags tag) {
try {
writeLock.lock();
datastore.delete(tagWithProjectIdAndEntity(tag.getProjectId(), tag.getEntity()));
datastore.save(tag);
} finally {
writeLock.unlock();
}
}
代码示例来源:origin: groupon/DotCi
public void delete(final DbBackedProject project) {
getDatastore().delete(getQuery(project));
}
代码示例来源:origin: protegeproject/webprotege
@Override
public void clearWebhooks(@Nonnull ProjectId projectId) {
Query<SlackWebhook> query = datastore.createQuery(SlackWebhook.class).field(PROJECT_ID).equal(projectId);
datastore.delete(query);
}
代码示例来源:origin: acmeair/acmeair
@Override
public void invalidateSession(String sessionid) {
Query<CustomerSessionImpl> q = datastore.find(CustomerSessionImpl.class).field("_id").equal(sessionid);
datastore.delete(q);
}
代码示例来源:origin: org.actframework/act-morphia
@Override
public void deleteBy(String fields, Object... values) throws IllegalArgumentException {
ds().delete(q(fields, values).morphiaQuery());
}
代码示例来源:origin: RestExpress/RestExpress-Examples
public void deleteByBlogEntryIds(Iterable<Identifier> blogEntryIds)
{
if (blogEntryIds.iterator().hasNext())
{
Query<Comment> comments = getDataStore().createQuery(Comment.class).field("blogEntryId").in(blogEntryIds);
getDataStore().delete(comments);
}
}
}
代码示例来源:origin: BlackLabs/play-morphia
@Override
public void _delete() {
if (isNew()) return;
_h_OnDelete();
ds().delete(this);
_h_Deleted();
deleted_ = true;
}
代码示例来源:origin: org.actframework/act-morphia
@Override
public void delete(MODEL_TYPE entity) {
ds().delete(entity);
EventBus eventBus = app.eventBus();
eventBus.trigger(new DeleteEvent<>(entity));
}
代码示例来源:origin: org.actframework/act-morphia
@Override
public void drop() {
ds().delete(ds().createQuery(modelType()));
}
代码示例来源:origin: groupon/DotCi
public void delete(final DynamicProject project) {
// TODO do this in a query not iteratively in memory
for (final DynamicSubProject subProject : getChildren(project)) {
this.dynamicBuildRepository.delete(subProject);
getDatastore().delete(subProject);
}
this.dynamicBuildRepository.delete(project);
getDatastore().delete(project);
final BuildNumberCounter seq = getDatastore().createQuery(BuildNumberCounter.class).disableValidation().field("key").equal(project.getFullName()).get();
if (seq != null) {
getDatastore().delete(seq);
}
}
代码示例来源:origin: RestExpress/RestExpress-Examples
public void deleteByBlogEntryId(UUID blogEntryId)
{
Query<Comment> comments = getDataStore().createQuery(Comment.class).field("blogEntryId").equal(blogEntryId);
getDataStore().delete(comments);
}
代码示例来源:origin: RestExpress/RestExpress-Examples
public void deleteByBlogId(UUID blogId)
{
Query<BlogEntry> blogEntries = getDataStore().createQuery(BlogEntry.class).field("blogId").equal(blogId);
getDataStore().delete(blogEntries);
}
}
内容来源于网络,如有侵权,请联系作者删除!