Delete is not cascaded for enhanced entities, resulting in foreign key constraint error in database. The same code works if entities are not enhanced. I will attach the test case.