I\'m having 2 Entities. Thread entity and Post entity using OnetoOne mapping from Post->Thread.
A Thread
This is what I did to resolve this problem based on Spring Boot.
Solution
from
// application.properties
spring.jpa.database-platform=org.hibernate.dialect.MySQLDialect
to
spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect
Explanation
As you can see below, it seems like the default value for CascadeDelete at MySQL5InnoDBDialect.java only support Cascade.
// MySQLDialect.java
@Override
public boolean supportsCascadeDelete() {
return false;
}
// MySQL5InnoDBDialect.java
@Override
public boolean supportsCascadeDelete() {
return true;
}