public void deleteByCid(long cid) {
   MongoTemplate mongoTemplate = getMongoTemplate();
   mongoTemplate.remove(
       new Query(Criteria.where(MongoEntityConstants.CAMPAIGN_ID).is(cid)),
       getEntityClass(),
       MongoEntityConstants.BAK_CAMPAIGN);
 }
Пример #2
0
 // Removes an user from the repository.
 public void removeUsuario(String id) throws Exception {
   UsuarioSiar existingUser =
       siarmongoTemplate.findById(new ObjectId(id), UsuarioSiar.class, "usuarioSiarTable");
   if (existingUser == null) {
     throw new Exception("User not found");
   }
   siarmongoTemplate.remove(existingUser, "usuarioSiarTable");
 }
Пример #3
0
  @Override
  public void remove(DocumentDAO document) {
    mongoTemplate.findAndModify(
        new Query(Criteria.where("position").gt(document.getPosition())),
        new Update().inc("position", -1),
        ProjectDAO.class);

    mongoTemplate.remove(document);
  }
 /** Delete a {<span class="referer">@link</span> Task} for a particular id. */
 public boolean deleteObjectById(String id) {
   WriteResult result = mongoTemplate.remove(new Query(Criteria.where("uid").is(id)), Task.class);
   result.getLastError();
   if (null != result) {
     if (result.getN() > 0) {
       return true;
     }
   }
   return false;
 }
 @Override
 public boolean deleteObject(Task object) {
   WriteResult result = mongoTemplate.remove(object);
   result.getLastError();
   if (null != result) {
     if (result.getN() > 0) {
       return true;
     }
   }
   return false;
 }
 /* (non-Javadoc)
  * @see com.sj.stack.core.IArticle#removeArticle(com.sj.model.Articles)
  */
 public void removeArticle(String id) {
   // TODO Auto-generated method stub
   Query searchArticleQuery = new Query(Criteria.where("id").is(id));
   Articles searchedArticle = mongoTemplate.findOne(searchArticleQuery, Articles.class);
   mongoTemplate.remove(searchedArticle);
 }
Пример #7
0
 public void deletar(ENTIDADE entidade) {
   if (entidade != null) mongo.remove(entidade); // remove a entidadeClass do banco de dados
 }
Пример #8
0
 public void remove(String id) {
   Query query = Query.query(Criteria.where("id").is(id));
   template.remove(query, CartVO.class);
 }
 public void delete(String id) {
   MongoTemplate mongoTemplate = this.getMongoTemplate();
   Query query = new Query(Criteria.where("id").is(new ObjectId(id)));
   mongoTemplate.remove(query, Drug.class);
 }
Пример #10
0
 @Override
 public void delete(ObjectId thesisDefenceId) {
   Query query = new Query(Criteria.where("_id").is(thesisDefenceId));
   mongoTemplate.remove(query);
 }
 /**
  * deletes a {@link Account}
  *
  * @param account the user storage account to delete
  */
 public void delete(Account account) {
   db.remove(account);
 }
 /**
  * deletes a {@link Account}
  *
  * @param id id of the user storage account to delete
  */
 public void delete(String id) {
   db.remove(Query.query(new Criteria("id").is(id)), Account.class);
 }
Пример #13
0
 public void delete(T entity) {
   mongoTemplate.remove(entity);
 }
 public int deleteByStatus(GeographicalAreaReplicationStatus status) {
   return template.remove(query(where("status").is(status)), GeographicalArea.class).getN();
 }
Пример #15
0
 @Override
 public void deleteUserProfile(UserProfile profile) {
   m_template.remove(profile);
   deleteAvatar(profile.getUserName());
 }