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; } }
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"; } }
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; } }
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; } }