public void deleteBooks(long booksId, long companyId) { Books books; try { books = booksPersistence.findByPrimaryKey(booksId); } catch (SystemException e) { e.printStackTrace(); return; } catch (NoSuchooksException e) { e.printStackTrace(); return; } deleteBooks(books, companyId); }
public Books updateBooks(Books booksParam, long userId) throws PortalException { Books booksVar; try { booksVar = booksPersistence.findByPrimaryKey(booksParam.getBookId()); booksVar.setTitle(booksParam.getTitle()); booksVar.setAuthor(booksParam.getAuthor()); booksVar.setIsbn(booksParam.getIsbn()); booksVar.setSummary(booksParam.getSummary()); booksVar.setCompanyId(booksParam.getCompanyId()); booksVar.setGroupId(booksParam.getGroupId()); booksVar.setTitle(booksParam.getTitle()); User user = userLocalService.getUser(userId); return booksPersistence.update(booksVar, true); } catch (NoSuchooksException e1) { // TODO Auto-generated catch block e1.printStackTrace(); return booksVar = null; } catch (SystemException e1) { // TODO Auto-generated catch block e1.printStackTrace(); return booksVar = null; } }