日期:2014-05-18  浏览次数:20631 次

关于删除有关联关系的实体的问题
if   (!deleteId.equals( " ")   &&   deleteId.trim().length()   >   0
                        &&   !deleteId.equals( "undefined "))   {
                        ApplyPostActivity   applyPostActivity   =   (ApplyPostActivity)   applyPostActivityService.getFinder()
                                                                                                                                                                                            .findById(new   Long(activityId));
                        Post   post   =   (Post)   loadEntity(Post.class,   new   Long(deleteId));
                        post.setAppliedAmount(new   BigDecimal(0));
//                         if   (applyPostActivity.getStatus()
//                                                                   .equals(BusinessActivity.IN_PROCESS))   {
//                                 applyPostService.submitApplyPost(applyPostActivity.getId());
//                         }
                        System.out.println( "---------------------------------------------》删除资金成功!! ");
                        applyPostActivity.getPostActivityDetail()
                                                          .getPostItems()
                                                          .remove(post);
                        persistenceServiceFactory.getPersistenceService(ApplyPostActivity.class)
                                                                          .update(applyPostActivity);
                        entityManager.deleteById(Post.class,   new   Long(deleteId));