Below issue comes up when I delete Loan entity. Ran app with hibernate show-sql:true and found null, in a query build by hibernate.
Hibernate: update activity set loan_id=null where loan_id=?
2020-07-14 23:53:20.944 WARN 13820 --- [nio-6080-exec-3] o.h.engine.jdbc.spi.SqlExceptionHelper : SQL Error: 19, SQLState: null
Followed this answer, 'Cascade.ALL' in entity class didnt help. Do I have option other than add lines to find and delete the child entities first, then attempt loan deletion.
ER diagram:
Git link in case needed.