Walter Stovall
2017-05-15 11:55:48 UTC
I have layers setup in a Oracle database on a build of the master branch geoserver. I have primary keys configured with gt_pk_metadata and configured in the dataStore. When the layer is based on a table geoserver correctly uses the sequence generator to generate new FIDs on the layer. If based on a virtual table, it does not.
Doing some debugging of the code shows that for the virtual table a SequencedPrimaryKeyColumn is never instantiated but for my table-layer it is. This traces back to the following code in JDBCDataStore that executes only in the case of a NON virtual table...
pkey = primaryKeyFinder.getPrimaryKey(this, databaseSchema, tableName, cx);
The alternative code executed for virtual tables does not use the primaryKeyFinder and instead does this:
kcols.add(new NonIncrementingPrimaryKeyColumn(pkName, binding));
}
pkey = new PrimaryKey(tableName, kcols);
This looks like a bug related to updatable features. I'm trying to find a way around it so my sequence generator will be used. Can anybody suggest something?
Doing some debugging of the code shows that for the virtual table a SequencedPrimaryKeyColumn is never instantiated but for my table-layer it is. This traces back to the following code in JDBCDataStore that executes only in the case of a NON virtual table...
pkey = primaryKeyFinder.getPrimaryKey(this, databaseSchema, tableName, cx);
The alternative code executed for virtual tables does not use the primaryKeyFinder and instead does this:
kcols.add(new NonIncrementingPrimaryKeyColumn(pkName, binding));
}
pkey = new PrimaryKey(tableName, kcols);
This looks like a bug related to updatable features. I'm trying to find a way around it so my sequence generator will be used. Can anybody suggest something?