perhaps make this a type => sql name map and re-use it in _foreignOnClause too - since they seem to be the ~same