public Resolution delete() { song = musicFacade.getSongById(song.getId()); try { musicFacade.delete(song); } catch (DataAccessException ex) { } return new RedirectResolution(this.getClass(), "list"); }
@Before( stages = LifecycleStage.BindingAndValidation, on = {"edit", "save", "details"}) public void loadSongFromDatabase() { String ids = getContext().getRequest().getParameter("song.id"); if (ids == null) { return; } song = musicFacade.getSongById(Long.parseLong(ids)); }