I am attempting to create a entry in my database and have figured out how to update a existing row through a POST request. I am having trouble figuring out how to create a entry every time my function is called. I am using the `.save()` function from CrudRepository and that does seem to do what it says and saved to an existing entry but not create. Can someone help me out with this? maybe I am just missing something small.
Yes, using save() in CrudRepository is to save the entity. But you need to make sure your Spring Boot application is connecting to the DB.
Here is a reference:
https://spring.io/guides/gs/accessing-data-mysql/
Method save() in CrudRepository does not necessarily create new table record, if you use same entity id/primary key with different data, it will execute as UPDATE of existing record, not INSERT of new one.