コード例 #1
0
 public T findByTitle(BLookup bLookup) {
   try {
     EventLogManager.eventLog(
         eventLogService,
         null,
         BLookup.class.getSimpleName(),
         EventLogType.SEARCH,
         bLookup.getEffectorUser());
     return (T) bLookupDAO.findByTitle(bLookup.getTitle());
   } catch (Exception e) {
     return null;
   }
 }
コード例 #2
0
 public String deleteBLookup(T entity) {
   try {
     EventLogManager.eventLog(
         eventLogService,
         String.valueOf(entity.getId()),
         BLookup.class.getSimpleName(),
         EventLogType.DELETE,
         entity.getEffectorUser());
     bLookupDAO.delete(entity);
     return "operation.occurred";
   } catch (Exception e) {
     return "FALSE";
   }
 }
コード例 #3
0
 public boolean editBLookup(T entity) {
   try {
     EventLogManager.eventLog(
         eventLogService,
         String.valueOf(entity.getId()),
         BLookup.class.getSimpleName(),
         EventLogType.EDIT,
         entity.getEffectorUser());
     bLookupDAO.update(entity);
     return true;
   } catch (Exception e) {
     return false;
   }
 }
コード例 #4
0
  public T createBLookup(T entity) {
    try {
      entity.setId(getMaximumId());
      /**/
      //            LanguageManagement languageManagement = new LanguageManagement();
      //            languageManagement.setTitle(entity.getTitleText() == null ? "" :
      // entity.getTitleText());
      //            languageManagement.setType(entity.getCurrentLang());
      //            languageManagementService.createLanguageManagement(languageManagement);
      //
      //            Set list = new HashSet();
      //            list.add(languageManagement);
      //
      //            LanguageKeyManagement languageKeyManagement = new LanguageKeyManagement();
      //            languageKeyManagement.setDescriptionKey(entity.getId() +
      // BLookup.class.getSimpleName());
      //            languageKeyManagement.setLanguageManagements(list);
      //            entity.setTitle(entity.getId() + BLookup.class.getSimpleName());
      //            languageKeyManagementService.createLanguageKeyManagement(languageKeyManagement);

      /**/

      BLookup bLookup = new BLookup(entity.getId(), entity.getTitleText(), entity.getLookup());
      bLookup = (T) bLookupDAO.create(bLookup);

      EventLogManager.eventLog(
          eventLogService,
          String.valueOf(bLookup.getId()),
          BLookup.class.getSimpleName(),
          EventLogType.ADD,
          entity.getEffectorUser());
      return (T) bLookup;
    } catch (Exception e) {
      return null;
    }
  }