Мне нравится отправлять данные из моей спины в базу данных postgres.
На самом деле у меня есть класс Car DAO:
@Repository
public interface CarDao extends JpaRepository<Car, Integer> {
Car findByIdentifiant(String identifiantCar);
@Transactional
@Modifying(clearAutomatically = true)
@Query("UPDATE Car SET ctn_map = :map WHERE ctn_identifiant = :identifiant")
void updateCar(@Param("identifiant") String identifiantCar, @Param("map") Cell[][] cell);
}
MapWebServices:
@RestController
@RequestMapping("/Map")
@CrossOrigin(origins = {"http://localhost:4200", "http://100.105.100.10"})
public class MapWebServices {
@Autowired
MapService MapService;
@Autowired
CarDao CarDao;
@GetMapping(value = "/all", produces = MediaType.APPLICATION_JSON_VALUE)
public Cell[][] getMapGlobal() {
saveMapLocale("Audi");
return MapService.getMapGlobal();
}
public void saveMapLocale(String identifiantCar){
CarDao.updateCar(identifiantCar, MapService.getMapGlobal());
}
}
Моя цель - обновить столбец массива моей таблицы (Car)