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

Update Neo4j extension to use Java 17 and Spring Data Neo4j #125

Merged
merged 6 commits into from
Aug 20, 2024

Conversation

meistermeier
Copy link
Collaborator

@meistermeier meistermeier commented Jan 4, 2024

This is a rather large PR because it will remove the Neo4j-OGM dependency and replace it with the Spring Data Neo4j.

Some background information to clarify the situation:
The official Spring Data Neo4j was rewritten a few years ago to not depend on Neo4j-OGM anymore (in Spring Boot version since 2.4).
This current (old) implementation is based on the fact that the Spring Boot starter still brings Neo4j-OGM as a dependency and makes use of the configured SessionFactory instance, that does not exist anymore.

Pros: No need to specify the query parts anymore but only one query/statement based on the Neo4j Cypher-DSL (https://github.com/neo4j-contrib/cypher-dsl) for readers
Cons: The writer needs now, instead of the single SessionFactory,

  • the Neo4jMappingContext to have knowledge about the entities
  • the Neo4jTemplate for loading and mapping entities
  • the (Neo4j)Driver for the simple delete operations.

While changing the mapping layer component, I decided also to upgrade all other dependencies to latest.


## Minimal Spring Boot example

With a Spring Boot application containing the additional dependencies `spring-boot-starter-neo4j` and `spring-batch-neo4j`,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That should go together with the following sentence.

x, y, z are needed and b must be excluded. See the following gradle for a minimal example,

@mbollemeijer
Copy link

Is there any ETA on when this will be merged ?

@michael-simons
Copy link
Collaborator

I cannot neither make an assumption on it, nor merge it myself.

@meistermeier
Copy link
Collaborator Author

If there is demand to get this in, I would like to get some feedback from @mdeinum or @dgray16 here (at least they seem pretty active in the past).
No problem for me to check possible upgrades and apply some needed adjustments before merge.

If this is up to us alone, I am technical able to do the merge, but please let us know.

Copy link
Collaborator

@dgray16 dgray16 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not have a chance to work with Neo4j so I cannot add a proper review for the logic, but dropping you some general ideas.

Also it would be great to have integration tests with Testcotainers.

Anyway LGTM. Thanks for your efforts!

@meistermeier
Copy link
Collaborator Author

Thanks for your input, @dgray16
I added the suggested changes. Don't have any preferences of whitespace formatting, so I adjusted it to spaces 😃
Would be nice to get a last sanity check on this. I am happy to squash and merge it later.

@meistermeier meistermeier merged commit 41cbb93 into spring-projects:main Aug 20, 2024
5 checks passed
@meistermeier meistermeier deleted the neo4j-update branch August 20, 2024 15:50
@scordio scordio added this to the Spring Batch Neo4j 1.0.0 milestone Nov 8, 2024
@scordio scordio changed the title Update Neo4j extension to use Spring Data Neo4j. Update Neo4j extension to use Spring Data Neo4j Nov 8, 2024
@scordio scordio changed the title Update Neo4j extension to use Spring Data Neo4j Update Neo4j extension to use Java 17 and Spring Data Neo4j Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants