@Test public void deleteConnector() { ChargingStationType chargingStationType = getChargingStationTypeNonTransient(entityManagerFactory); io.motown.chargingstationconfiguration.viewmodel.persistence.entities.Evse evse = Iterables.get(chargingStationType.getEvses(), 0); Connector connector = Iterables.get(evse.getConnectors(), 0); domainService.deleteConnector(chargingStationType.getId(), evse.getId(), connector.getId()); }
public void deleteConnector(Long chargingStationTypeId, Long evseId, Long id) { ChargingStationType chargingStationType = chargingStationTypeRepository.findOne(chargingStationTypeId); Evse evse = getEvseById(chargingStationType, evseId); Connector connector = getConnectorById(evse, id); evse.getConnectors().remove(connector); chargingStationTypeRepository.createOrUpdate(chargingStationType); }
DomainService { public void deleteConnector(Long chargingStationTypeId, Long evseId, Long id) { ChargingStationType chargingStationType = chargingStationTypeRepository.findOne(chargingStationTypeId); Evse evse = getEvseById(chargingStationType, evseId); Connector connector = getConnectorById(evse, id); evse.getConnectors().remove(connector); chargingStationTypeRepository.createOrUpdate(chargingStationType); } }
DomainService { public void deleteConnector(Long chargingStationTypeId, Long evseId, Long id) { ChargingStationType chargingStationType = chargingStationTypeRepository.findOne(chargingStationTypeId); Evse evse = getEvseById(chargingStationType, evseId); Connector connector = getConnectorById(evse, id); evse.getConnectors().remove(connector); chargingStationTypeRepository.createOrUpdate(chargingStationType); }  }
DomainService { public void deleteConnector(Long chargingStationTypeId, Long evseId, Long id) { ChargingStationType chargingStationType = chargingStationTypeRepository.findOne(chargingStationTypeId); Evse evse = getEvseById(chargingStationType, evseId); Connector connector = getConnectorById(evse, id); evse.getConnectors().remove(connector); chargingStationTypeRepository.createOrUpdate(chargingStationType); }  Set<io.motown.domain.api.chargingstation.Evse> getEvses(String vendor, String model); Evse createEvse(Long chargingStationTypeId, Evse evse); Set<Evse> getEvses(Long chargingStationTypeId); ChargingStationType createChargingStationType(ChargingStationType chargingStationType); ChargingStationType updateChargingStationType(Long id, ChargingStationType chargingStationType); List<ChargingStationType> getChargingStationTypes(int offset, int limit); Long getTotalNumberOfChargingStationTypes(); ChargingStationType getChargingStationType(Long id); void deleteChargingStationType(Long id); Set<Connector> getConnectors(Long chargingStationTypeId, Long evseId); Connector createConnector(Long chargingStationTypeId, Long evseId, Connector connector); Connector updateConnector(Long chargingStationTypeId, Long evseId, Connector connector); Connector getConnector(Long chargingStationTypeId, Long evseId, Long id); void deleteConnector(Long chargingStationTypeId, Long evseId, Long id); Evse updateEvse(Long chargingStationTypeId, Evse evse); Evse getEvse(Long chargingStationTypeId, Long id); void deleteEvse(Long chargingStationTypeId, Long id); Manufacturer createManufacturer(Manufacturer manufacturer); Manufacturer updateManufacturer(Long id, Manufacturer manufacturer); List<Manufacturer> getManufacturers(int offset, int limit); Long getTotalNumberOfManufacturers(); Manufacturer getManufacturer(Long id); void deleteManufacturer(Long id); void setChargingStationTypeRepository(ChargingStationTypeRepository chargingStationTypeRepository); void setManufacturerRepository(ManufacturerRepository manufacturerRepository); }
DomainService { public void deleteConnector(Long chargingStationTypeId, Long evseId, Long id) { ChargingStationType chargingStationType = chargingStationTypeRepository.findOne(chargingStationTypeId); Evse evse = getEvseById(chargingStationType, evseId); Connector connector = getConnectorById(evse, id); evse.getConnectors().remove(connector); chargingStationTypeRepository.createOrUpdate(chargingStationType); }  Set<io.motown.domain.api.chargingstation.Evse> getEvses(String vendor, String model); Evse createEvse(Long chargingStationTypeId, Evse evse); Set<Evse> getEvses(Long chargingStationTypeId); ChargingStationType createChargingStationType(ChargingStationType chargingStationType); ChargingStationType updateChargingStationType(Long id, ChargingStationType chargingStationType); List<ChargingStationType> getChargingStationTypes(int offset, int limit); Long getTotalNumberOfChargingStationTypes(); ChargingStationType getChargingStationType(Long id); void deleteChargingStationType(Long id); Set<Connector> getConnectors(Long chargingStationTypeId, Long evseId); Connector createConnector(Long chargingStationTypeId, Long evseId, Connector connector); Connector updateConnector(Long chargingStationTypeId, Long evseId, Connector connector); Connector getConnector(Long chargingStationTypeId, Long evseId, Long id); void deleteConnector(Long chargingStationTypeId, Long evseId, Long id); Evse updateEvse(Long chargingStationTypeId, Evse evse); Evse getEvse(Long chargingStationTypeId, Long id); void deleteEvse(Long chargingStationTypeId, Long id); Manufacturer createManufacturer(Manufacturer manufacturer); Manufacturer updateManufacturer(Long id, Manufacturer manufacturer); List<Manufacturer> getManufacturers(int offset, int limit); Long getTotalNumberOfManufacturers(); Manufacturer getManufacturer(Long id); void deleteManufacturer(Long id); void setChargingStationTypeRepository(ChargingStationTypeRepository chargingStationTypeRepository); void setManufacturerRepository(ManufacturerRepository manufacturerRepository);  }