fix combination of primary key expressions
use defined primary key when building query
handle geoalchemy fields