Hi,
Check the ”Expose primary keys” option from the setting of the datastore. Normally primary keys are not exposed because they are used as unique identifiers in WFS layers and FIDs are important for the system but not for the users. Especially with WFS-T it would be a very bad idea to let users to edit FIDs as if they were normal attributes. However, because primary keys are often made from some attribute like parcel IDs which hold important information. In that case they can be published with the mentioned option. If you do not want to publish PK of all the layers from the datastore you have found a workaround of using a view. Sometimes the PK column must be selected twice to the view, once for the FID that gets hidden and another time with a different name for publishing it to the users.
-Jukka Rahkonen-
···
Roel De Nijs wrote:
Hi list,
When I create a new layer based on a table in a sql server database, all properties are shown under “Feature Type Details” except for the table column which is marked as primary key. The definition of this PK column looks like: [MI_PRINX] [int] IDENTITY(1,1) NOT NULL
When I create a view based on this table (selecting all columns in the table) and then create a new layer based on this view, I get all columns (including the primary key one) in the “Feature Type Details” section.
Experiencing this behavior in geoserver 2.4.0, 2.5.2 and 2.6.1 using both Microsoft’s jdbc drivers sqljdbc4-4.0.2206.100 and sqljdbc41-4.1.5605.100.
Any ideas? A limitation on the name of a PK column?
Kind regards,
Roel De Nijs
Senior Java Developer
Volg Aquafin op Facebook | Twitter | YouTube | LinkedIN
Disclaimer: zie www.aquafin.be P Denk aan het milieu. Druk deze mail niet onnodig af.