Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support newly added data types in Neo4j #94

Open
amadfida opened this issue Aug 26, 2018 · 7 comments
Open

Support newly added data types in Neo4j #94

amadfida opened this issue Aug 26, 2018 · 7 comments

Comments

@amadfida
Copy link

We would like to request some enhancements to neo4j-gorm to support new data types

  1. Java 8 date/time : Currently all dates are stored as long
  2. Geospatial types i.e. Point

More information can be found here : https://neo4j.com/docs/developer-manual/current/drivers/cypher-values/

Let me know if you have any questions.

Thanks

@amadfida
Copy link
Author

@jameskleeh can you provide your feedback or if you need more information?

@graemerocher
Copy link
Member

Should be a matter of updating the https://github.com/grails/gorm-neo4j/blob/master/grails-datastore-gorm-neo4j/src/main/groovy/org/grails/datastore/gorm/neo4j/Neo4jMappingContext.java#L47 list to include the types and potentially adding converters

However some of the types added require Java 8 so this cannot go into 6.1.x and must wait until 7.x which will be Java 8 only

@jameskleeh
Copy link
Contributor

@amadfida It's possible we can support this through the grails-java8 plugin. I'll be looking into what is necessary to get it to work.

@jameskleeh
Copy link
Contributor

@amadfida I cannot reproduce your claim that all the dates are stored as long. I have the following types in my domain (per the neo4j docs):

    LocalDate
    OffsetTime
    LocalTime
    ZonedDateTime
    LocalDateTime

Saving an instance produces:

"properties": {
          "a": "2018-09-05",
          "b": "10:22:27.837-04:00",
          "c": "10:22:27.839",
          "d": "2018-09-05T10:22:27.841-04:00[America/New_York]",
          "e": "2018-09-05T10:22:27.843",
          "version": {
            "low": 0,
            "high": 0
          }
        }

When I attempt to read the domain, those properties are null, however they look like they are stored correctly to me. Can you verify?

@jameskleeh
Copy link
Contributor

@amadfida Native support for those types was not added until driver version 1.6. Here are things we can do:

  1. Upgrade the neo4j driver to 1.6 in neo4j-gorm 6.2.0 (not released yet).
  2. Register converters with the grails-java8 plugin to allow JSR310 dates to work in the current 6.1.x neo4j-gorm.

I'm not sure we can do anything about the new spatial types in neo4j-gorm 6.1.x since I believe that requires driver support.

Let me know your thoughts

@amadfida
Copy link
Author

amadfida commented Sep 5, 2018

@jameskleeh we can target it for neo4j-gorm 6.2.0.

@jameskleeh
Copy link
Contributor

@amadfida I've updated 6.2.0.BUILD-SNAPSHOT to use the latest driver. Can you test to see if it is working as expected?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants