Editar registro en Base de Datos

Recuperar registro y envira al formulario

<table th:if="${not projects.isEmpty()}" class="table">
    <thead class="">
        <tr>
            <th>Titulo</th>
            <th>Descripción</th>
            <th>Url</th>
            <th>Editar</th>
            <th>Eliminar</th>
        </tr>
    </thead>
    <tbody>
        <tr th:each="project: ${projects}">
            <td th:text="${project.title}"></td>
            <td th:text="${project.description}"></td>
            <td><a th:href="${project.url}" th:text="${project.url}"></a>
            </td>
            <td>
                <a th:href="@{/project/edit/}+${project.idProject}" >Editar</a>
            </td>
                    
            <td>
                <a href="#">Eliminar</a>
            </td>
        </tr>
    </tbody>
</table>

En el controlador agregar el método para modificar

@GetMapping("/edit/{idProject}")
    public String editProject(Project project, Model model) {
        project = projectService.searchProject(project);
        model.addAttribute("project",project);
        return "modify_project";
    }

Para modificar y guardar el ID crear un campo oculto

<input type="hidden" name="idProject" th:field="*{idProject}"/>