orbisgis / h2gis-geotools

H2GIS Datastore for the Geotools library
GNU Lesser General Public License v3.0
1 stars 5 forks source link

Cannot get Primary Key from file table #30

Open ebocher opened 2 years ago

ebocher commented 2 years ago

H2GIS implements a FileTable system based on H2 TableEngine to link ShapeFile. The FileTable emulates a PrimaryKey called PK. This primary key is not detected by Geotools MetadataTablePrimaryKeyFinder class because GT uses a static array to set the table type name new String[]{"TABLE", "VIEW"}. see : https://github.com/geotools/geotools/blob/23fa5182c10909eccd6b28c3be28f78bbf7b1db9/modules/library/jdbc/src/main/java/org/geotools/jdbc/MetadataTablePrimaryKeyFinder.java#L124 It would be nice to use the getDesiredTablesType from the SQLDialect so we can set the good table candidates.

ebocher commented 2 years ago

An issue has been opened on GT https://osgeo-org.atlassian.net/browse/GEOT-7156