Dear Andrea,

Le 06/04/2015 09:13, Andrea Aime a écrit :
Hi,
thanks for contacting us, comments inline

On Fri, Apr 3, 2015 at 3:35 PM, Erwan Bocher <erwan.boc...@ec-nantes.fr <mailto:erwan.boc...@ec-nantes.fr>> wrote:


    Dear geotools developers,

    I'm developing an extension to link H2GIS -  H2 database with
    Geoserver.
    The code source is available here
    https://github.com/ebocher/geoserver-h2gis/tree/H2gis_linkedTable.


Interesting, could you compare that with the GeoTools H2 datastore?
H2GIS datastore is inspired from PostGISdatastore.


    Because H2 database supports linked table and H2GIS uses this custom
    file system to link geospatial file as shapefile (see an example here
    http://www.h2gis.org/docs/dev/FILE_TABLE/), I'd like to find a way to
    set the table types supported by the H2 database.

    If I'm not wrong this requirement can be solved with two single
    changes :

    1. Add a method in SQLDialect to specify the desired tables

    /**
          * @return Table types filtered from jdbc {@link
    DatabaseMetaData}
          */
         public String[] getDesiredTablesType() {
             return new String[]{"TABLE", "VIEW", "MATERIALIZED VIEW",
    "SYNONYM"};
         }

    2. Change JDBCDataStore to use the method getDesiredTablesType()

    In createTypeNames{...

      DatabaseMetaData metaData = cx.getMetaData();

      ResultSet tables = metaData.getTables(null,
    escapeNamePattern(metaData, databaseSchema),
                         "%", dialect.getDesiredTablesType());

    }

    When the developer wants to add custom table types, just overwrite
    like this

      @Override
         public String[] getDesiredTablesType() {
             return new String[]{"TABLE", "VIEW", "MATERIALIZED VIEW",
    "SYNONYM", "TABLE LINK", "EXTERNAL"};
         }

    I have added an example here
    
https://github.com/ebocher/geoserver-h2gis/blob/H2gis_linkedTable/src/main/java/org/orbisgis/geoserver/h2gis/datastore/H2GISDialect.java

    Ihope it's clear.


Yep, the change is small and self contained, no issues here.

The other two comments I've made on your pull request still apply:
* The pull request needs to be redone, it contains several changes that are unrelated (15 files changed, but you wanted to change only 2). * Also check the contribution guide for _copyright assignment_ and other procedures (and yes, ok not to have tests on this one)
http://docs.geotools.org/latest/developer/procedures/contribute.html

Since you seem to be an expert in H2, I have a question for you. In GeoTools and GeoServer we use H2 in
multiple places, but an old version of it.
This is mostly because H2 changed the on disk format, and apparently did not include an automatic upgrade procedure for it... which is a serious problem when users are upgrading existing installations.
Do you know of a way to make the upgrades transparent?
A yes. Good question.

The new database engine MVStore is very efficient but not yet stable. Currently in my team, we are maintaining two branches one with MVStore and the other with the old page store engine. If you want to upgrade H2 set MVSTORE=false in you JDBC URL.
Maybe, @Nicolas (in copy) has a better proposal ?

Cheers.

Erwan


Cheers
Andrea

--
==
GeoServer Professional Services from the experts! Visit
http://goo.gl/NWWaa2 for more information.
==

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054  Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39  339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

*AVVERTENZE AI SENSI DEL D.Lgs. 196/2003*

Le informazioni contenute in questo messaggio di posta elettronica e/o nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il loro utilizzo è consentito esclusivamente al destinatario del messaggio, per le finalità indicate nel messaggio stesso. Qualora riceviate questo messaggio senza esserne il destinatario, Vi preghiamo cortesemente di darcene notizia via e-mail e di procedere alla distruzione del messaggio stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso, divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od utilizzarlo per finalità diverse, costituisce comportamento contrario ai principi dettati dal D.Lgs. 196/2003.

The information in this message and/or attachments, is intended solely for the attention and use of the named addressee(s) and may be confidential or proprietary in nature or covered by the provisions of privacy act (Legislative Decree June, 30 2003, no.196 - Italy's New Data Protection Code).Any use not in accord with its purpose, any disclosure, reproduction, copying, distribution, or either dissemination, either whole or partial, is strictly forbidden except previous formal approval of the named addressee(s). If you are not the intended recipient, please contact immediately the sender by telephone, fax or e-mail and delete the information in this message that has been received in error. The sender does not give any warranty or accept liability as the content, accuracy or completeness of sent messages and accepts no responsibility for changes made after they were sent or for other risks which arise as a result of e-mail transmission, viruses, etc.


-------------------------------------------------------

------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
_______________________________________________
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to