diff --git a/data-manager-api/src/main/java/org/orbisgis/datamanagerapi/dataset/ITable.java b/data-manager-api/src/main/java/org/orbisgis/datamanagerapi/dataset/ITable.java index da1939f8..c6201130 100644 --- a/data-manager-api/src/main/java/org/orbisgis/datamanagerapi/dataset/ITable.java +++ b/data-manager-api/src/main/java/org/orbisgis/datamanagerapi/dataset/ITable.java @@ -75,6 +75,7 @@ public interface ITable extends IDataSet { /** * Get the type of the column from the underlying table. * + * @param columnName set the name of the column * @return The type of the column. */ String getColumnsType(String columnName); diff --git a/data-manager-api/src/main/java/org/orbisgis/datamanagerapi/datasource/IJdbcDataSource.java b/data-manager-api/src/main/java/org/orbisgis/datamanagerapi/datasource/IJdbcDataSource.java index 82e770d5..bb00c5f5 100644 --- a/data-manager-api/src/main/java/org/orbisgis/datamanagerapi/datasource/IJdbcDataSource.java +++ b/data-manager-api/src/main/java/org/orbisgis/datamanagerapi/datasource/IJdbcDataSource.java @@ -95,7 +95,7 @@ public interface IJdbcDataSource extends IDataSource, GroovyObject { * * @param tableName Name of the table to check. * - * @return True if the table is found, false otherwise. + * @return True if {@link ITable} is found, false otherwise. */ boolean hasTable(String tableName); diff --git a/data-manager/src/main/java/org/orbisgis/datamanager/JdbcTable.java b/data-manager/src/main/java/org/orbisgis/datamanager/JdbcTable.java index aa19307d..a97fb83e 100644 --- a/data-manager/src/main/java/org/orbisgis/datamanager/JdbcTable.java +++ b/data-manager/src/main/java/org/orbisgis/datamanager/JdbcTable.java @@ -188,7 +188,7 @@ public ResultSetMetaData getMetaData(){ * * @return The parent DataSource. */ - public JdbcDataSource getJdbcDataSource(){ + protected JdbcDataSource getJdbcDataSource(){ return jdbcDataSource; } diff --git a/data-manager/src/main/java/org/orbisgis/datamanager/h2gis/H2GIS.java b/data-manager/src/main/java/org/orbisgis/datamanager/h2gis/H2GIS.java index f608fed5..5fa8d16f 100644 --- a/data-manager/src/main/java/org/orbisgis/datamanager/h2gis/H2GIS.java +++ b/data-manager/src/main/java/org/orbisgis/datamanager/h2gis/H2GIS.java @@ -243,6 +243,8 @@ public boolean hasTable(String tableName) { try { return JDBCUtilities.tableExists(connectionWrapper,TableLocation.parse(tableName, true).toString()); } catch (SQLException ex) { + LOGGER.error("Cannot find the table '" + tableName + ".\n" + + ex.getLocalizedMessage()); return false; } } diff --git a/data-manager/src/main/java/org/orbisgis/datamanager/postgis/POSTGIS.java b/data-manager/src/main/java/org/orbisgis/datamanager/postgis/POSTGIS.java index 9a958103..36b15e72 100644 --- a/data-manager/src/main/java/org/orbisgis/datamanager/postgis/POSTGIS.java +++ b/data-manager/src/main/java/org/orbisgis/datamanager/postgis/POSTGIS.java @@ -199,6 +199,8 @@ public boolean hasTable(String tableName) { try { return JDBCUtilities.tableExists(connectionWrapper,TableLocation.parse(tableName, false).toString()); } catch (SQLException ex) { + LOGGER.error("Cannot find the table '" + tableName + ".\n" + + ex.getLocalizedMessage()); return false; } } diff --git a/data-manager/src/test/groovy/org/orbisgis/datamanager/GroovyH2GISTest.groovy b/data-manager/src/test/groovy/org/orbisgis/datamanager/GroovyH2GISTest.groovy index ea2f2763..84316919 100644 --- a/data-manager/src/test/groovy/org/orbisgis/datamanager/GroovyH2GISTest.groovy +++ b/data-manager/src/test/groovy/org/orbisgis/datamanager/GroovyH2GISTest.groovy @@ -564,7 +564,6 @@ class GroovyH2GISTest { h2GIS.getSpatialTable("orbisgis").the_geom.createSpatialIndex() assertTrue h2GIS.getSpatialTable("orbisgis").the_geom.indexed assertTrue h2GIS.getSpatialTable("orbisgis").the_geom.spatialIndexed - h2GIS.getSpatialTable("orbisgis").the_geom.createSpatialIndex() } @Test @@ -629,5 +628,5 @@ class GroovyH2GISTest { """) def concat = "" println h2GIS.firstRow("select count(*) as nb from h2gis").nb - } + } }