Fixed "where" in db entity