Coder Social home page Coder Social logo

lionkim / movies-java-spring-data-neo4j Goto Github PK

View Code? Open in Web Editor NEW

This project forked from neo4j-examples/movies-java-spring-data-neo4j-3

0.0 2.0 0.0 143 KB

Neo4j Movies Demo App in java with spring-data-neo4j

Home Page: http://neo4j.com/developer/java

HTML 80.96% Java 19.04%

movies-java-spring-data-neo4j's Introduction

Spring Data Neo4j with Spring Boot and Spring Data Rest - Movies Example Application

Spring Data Neo4j was the first Spring Data project, started by the CEOs Rod Johnson and Emil Eifrem. It enables convenient integration of Neo4j in your Spring-based application. It provides object-graph mapping functionality and other features common to the Spring Data projects.

To use Neo4j with Spring Data Neo4j, you just add the dependency for Spring-Boot and Spring-Data-Neo4j to your build setup.

link:pom.xml[role=include]

After setting up a Java-based Spring-Boot configuration,

link:src/main/java/movies/spring/data/neo4j/MyNeo4jConfiguration.java[role=include]

and annotating your @Node- and @RelationshipEntity, you can use the Neo4jTemplate to access Neo4j APIs and object graph mapping functionality.

link:src/main/java/movies/spring/data/neo4j/domain/Movie.java[role=include]

Additionally you can leverage the convenient Spring-Data repositories to get interface-based DAO implementations injected into your Spring Components.

link:src/main/java/movies/spring/data/neo4j/repositories/MovieRepository.java[role=include]

In our case we use the repository from a MovieService to compute the graph representation for the visualization. The service is then injected into our main Boot application, which also doubles as @RestMvcController which exposes the /graph endpoint.

The other two endpoints for finding multiple movies by title and loading a single movie are provided out of the box by the Spring-Data-Rest project which exposes our MovieRepository as REST endpoints. The rendering of the movie objects (and related entities) happens automatically out of the box via Jackson mapping.

See the {github}/examples/java/spring-data-neo4j[GitHub repository] for the source code.

Note
The current version of Spring Data Neo4j works best with an embedded Neo4j database. To achieve highest-performance Neo4j-Server integration move your SDN persistence layer into a Server Extension.

The Stack

These are the components of our Web Application:

  • Application Type: Spring-Boot Java Web Application (Jetty)

  • Web framework: Spring-Boot enabled Spring-WebMVC, Spring-Data-Rest

  • Persistence Access: Spring-Data-Neo4j

  • Database: Neo4j-Server

  • Frontend: jquery, bootstrap, d3.js

Endpoints:

Get Movie

// JSON object for single movie with cast
curl http://localhost:8080/movies/search/findByTitle?0=The%20Matrix

// list of JSON objects for movie search results
curl http://localhost:8080/movies/search/findByTitleContaining?0=matrix

// JSON object for whole graph viz (nodes, links - arrays)
curl http://localhost:8080/graph

movies-java-spring-data-neo4j's People

Contributors

jexp avatar renatodelgaudio avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.