PostDeleteEventListener,PostInsertEventListener,PostUpdateEventListener

来源:互联网 发布:rpm卸载软件 编辑:程序博客网 时间:2024/06/05 02:54

public class DeleteResListener implements PostDeleteEventListener {
 /**
  * @Fields serialVersionUID : TODO(用一句话描述这个变量表示什么)
  */

 private static final long serialVersionUID = -7915712267532934913L;
 @Override
 public void onPostDelete(PostDeleteEvent event) {
  // TODO Auto-generated method stub
  
   if (event.getEntity() instanceof ResourceEntity) {
    // 注入Services
    ResSearchInfoServices resSearchInfoServices = (ResSearchInfoServices) SpringUtil
      .getBean("resSearchInfoServices");
    resSearchInfoServices.deleteRes(event);
   }
  }


}

ResourceEntity resourceEntity = (ResourceEntity) event.getEntity();
  // 原表主键ID
  String strDataID = resourceEntity.getDataId();