Details
Description
JDBCDataStore has a "exposePrimaryKeyColumns" property that allows for mapping the primary key columns as straigth attributes of a feature.
This is something that has been requested many times by GeoServer users. Yet, GS cannot use that property because it's not exposed by the factory.
The patch does not limit itself to expose the primary keys because working on it I noticed exposing primary keys broke almost all write attempts to the database.
This patch reworks the select and insert methods as well as the writer to deal with the extra columns. The update code path was not breaking.
However there is still a difference, whilst the insert path will ignore the exposed pk attribute values and will unpack the Feature identifier to get the values for those columns instead, the update path will actually execute the update even on those columns. Not sure what to do here.
I guess the best approach would be to use the value specified in the attribute if the column does not has a sequence or is auto-increment, and ignore it otherwise (and do so uniformly for insert and update).
Opinions?