Olá! Tentei fazer o procedimento e recebi erro 500. Debuguei o código e vi que a role está correta, mas algo não está indo certo.
Trecho do erro abaixo:
Hibernate: select projeto0_.id as id1_2_0_, projeto0_.descricao as descrica2_2_0_, projeto0_.titulo as titulo3_2_0_ from projeto projeto0_ where projeto0_.id=?
Hibernate: delete from projeto_habilidades where projeto_id=?
Hibernate: delete from projeto where id=?
[2m2021-05-07 15:14:51.532[0;39m [33m WARN[0;39m [35m15176[0;39m [2m---[0;39m [2m[nio-8080-exec-4][0;39m [36mo.h.engine.jdbc.spi.SqlExceptionHelper [0;39m [2m:[0;39m SQL Error: 1451, SQLState: 23000
[2m2021-05-07 15:14:51.584[0;39m [31mERROR[0;39m [35m15176[0;39m [2m---[0;39m [2m[nio-8080-exec-4][0;39m [36mo.h.engine.jdbc.spi.SqlExceptionHelper [0;39m [2m:[0;39m Cannot delete or update a parent row: a foreign key constraint fails (`equipes`.`users_projetos`, CONSTRAINT `FK5nlrmonjmutn3trjve9odhmro` FOREIGN KEY (`projetos_id`) REFERENCES `projeto` (`id`))
[2m2021-05-07 15:14:51.693[0;39m [32m INFO[0;39m [35m15176[0;39m [2m---[0;39m [2m[nio-8080-exec-4][0;39m [36mo.h.e.j.b.internal.AbstractBatchImpl [0;39m [2m:[0;39m HHH000010: On release of batch it still contained JDBC statements
[2m2021-05-07 15:14:52.146[0;39m [31mERROR[0;39m [35m15176[0;39m [2m---[0;39m [2m[nio-8080-exec-4][0;39m [36mo.a.c.c.C.[.[.[/].[dispatcherServlet] [0;39m [2m:[0;39m Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.dao.DataIntegrityViolationException: could not execute statement; SQL [n/a]; constraint [null]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute statement] with root cause
java.sql.SQLIntegrityConstraintViolationException: Cannot delete or update a parent row: a foreign key constraint fails (`equipes`.`users_projetos`, CONSTRAINT `FK5nlrmonjmutn3trjve9odhmro` FOREIGN KEY (`projetos_id`) REFERENCES `projeto` (`id`))
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:117) ~[mysql-connector-java-8.0.23.jar:8.0.23]