6

We have currently a rather convoluted way of using the Geometry fieldtype of PostGIS with JHipster (4.6, currently trying to upgrade to 4.14 - which is not going smoothly - will probably post another question for this)

  1. we added hibernate-spatial and liquibase-spatial to pom.xml
  2. then create the jdl Entities with String fields,
  3. import this with "jhipster import-jdl database.jdl"
  4. then change the entities to @Column(name = "geometry", columnDefinition="Geometry") private Geometry geometry
  5. mvnw compile liquibase:diff
  6. add reference to the generated change logs in master.xml
  7. remove statements that drop spatial tables in the generated change logs

and i probably forgot some steps inbetween...

Q: Is there a better way to integrate postgis into jhipster ?

In github i only found that the jhipster team does not want to integrate support for GIS Extensions into JHipster/JDL because they are not available everywhere.

Mohsen
  • 4,536
  • 2
  • 27
  • 49
Nenad
  • 181
  • 2
  • 6
  • 3
    At my company, Ippon which is the birthplace of JHipster we have already done a project integrating PostGIS and JHipter. Please have a look at this blog post (in french sorry) : http://blog.ippon.fr/2017/12/04/la-technologie-spatiale-au-service-de-jhipster/ I was not involved in the project itself so I cannot give you more info but I think that you need to define your liquibase changelog manually to resolve your issues. – Pierre Besson May 02 '18 at 22:12
  • @PierreBesson : Thanks for the article. I think it is more or less doing the same steps like us. We change the liquibase changelog in steps 5-7. – Nenad May 03 '18 at 14:54
  • continued... As we use JDL to define the entities we have to create the field with a type that JDL understands (e.g. String) and then have to change it to the real Geometry type. – Nenad May 03 '18 at 15:08

0 Answers0