hasChildren & ForeignKeyException