@Test public void deleteTest() { long count = venDemandResponseEventDao.count(); assertEquals(4L, count); demandResponseEventService.delete(event1.getId()); count = venDemandResponseEventDao.count(); assertEquals(2L, count); demandResponseEventService.delete(events); count = venDemandResponseEventDao.count(); assertEquals(0L, count); }
public boolean delete(Long id) { boolean exists = demandResponseEventDao.existsById(id); if (exists) { venDemandResponseEventDao.deleteByEventId(id); demandResponseEventDao.deleteById(id); } return exists; }
DemandResponseEventService { public boolean delete(Long id) { boolean exists = demandResponseEventDao.existsById(id); if (exists) { venDemandResponseEventDao.deleteByEventId(id); demandResponseEventDao.deleteById(id); } return exists; } }
DemandResponseEventService { public boolean delete(Long id) { boolean exists = demandResponseEventDao.existsById(id); if (exists) { venDemandResponseEventDao.deleteByEventId(id); demandResponseEventDao.deleteById(id); } return exists; }  }
DemandResponseEventService { public boolean delete(Long id) { boolean exists = demandResponseEventDao.existsById(id); if (exists) { venDemandResponseEventDao.deleteByEventId(id); demandResponseEventDao.deleteById(id); } return exists; }  @PostConstruct void init(); @Transactional(readOnly = false) DemandResponseEvent create(DemandResponseEventCreateDto dto); @Transactional(readOnly = false) DemandResponseEvent update(DemandResponseEvent event, DemandResponseEventUpdateDto dto); void distributeEventToPushVen(DemandResponseEvent event); @Transactional(readOnly = false) DemandResponseEvent publish(DemandResponseEvent event); @Transactional(readOnly = false) DemandResponseEvent active(DemandResponseEvent event); @Transactional(readOnly = false) DemandResponseEvent cancel(DemandResponseEvent event); Optional<DemandResponseEvent> findById(Long id); List<DemandResponseEventSignal> getSignals(DemandResponseEvent event); boolean delete(Long id); void delete(Iterable<DemandResponseEvent> entities); boolean hasResponded(String venId, DemandResponseEvent event); void updateVenDemandResponseEvent(Long demandResponseEventId, Long modificationNumber, String venUsername,
			DemandResponseEventOptEnum venOpt); VenDemandResponseEvent getVenDemandResponseEvent(Long demandResponseEventId, String venUsername); DemandResponseEventOptEnum getVenDemandResponseEventOpt(Long demandResponseEventId, String venUsername); List<DemandResponseEvent> findToSentEventByVenUsername(String username); List<DemandResponseEvent> findToSentEventByVenUsername(String username, Long size); List<VenDemandResponseEvent> getVenDemandResponseEvent(Long demandResponseEventId); Page<DemandResponseEvent> search(List<DemandResponseEventFilter> filters, Long start, Long end); Page<DemandResponseEvent> search(List<DemandResponseEventFilter> filters, Long start, Long end, Integer page,
			Integer size); }
DemandResponseEventService { public boolean delete(Long id) { boolean exists = demandResponseEventDao.existsById(id); if (exists) { venDemandResponseEventDao.deleteByEventId(id); demandResponseEventDao.deleteById(id); } return exists; }  @PostConstruct void init(); @Transactional(readOnly = false) DemandResponseEvent create(DemandResponseEventCreateDto dto); @Transactional(readOnly = false) DemandResponseEvent update(DemandResponseEvent event, DemandResponseEventUpdateDto dto); void distributeEventToPushVen(DemandResponseEvent event); @Transactional(readOnly = false) DemandResponseEvent publish(DemandResponseEvent event); @Transactional(readOnly = false) DemandResponseEvent active(DemandResponseEvent event); @Transactional(readOnly = false) DemandResponseEvent cancel(DemandResponseEvent event); Optional<DemandResponseEvent> findById(Long id); List<DemandResponseEventSignal> getSignals(DemandResponseEvent event); boolean delete(Long id); void delete(Iterable<DemandResponseEvent> entities); boolean hasResponded(String venId, DemandResponseEvent event); void updateVenDemandResponseEvent(Long demandResponseEventId, Long modificationNumber, String venUsername,
			DemandResponseEventOptEnum venOpt); VenDemandResponseEvent getVenDemandResponseEvent(Long demandResponseEventId, String venUsername); DemandResponseEventOptEnum getVenDemandResponseEventOpt(Long demandResponseEventId, String venUsername); List<DemandResponseEvent> findToSentEventByVenUsername(String username); List<DemandResponseEvent> findToSentEventByVenUsername(String username, Long size); List<VenDemandResponseEvent> getVenDemandResponseEvent(Long demandResponseEventId); Page<DemandResponseEvent> search(List<DemandResponseEventFilter> filters, Long start, Long end); Page<DemandResponseEvent> search(List<DemandResponseEventFilter> filters, Long start, Long end, Integer page,
			Integer size);  }