Skip to content

Commit

Permalink
Bael 6625 new (eugenp#14476)
Browse files Browse the repository at this point in the history
* BAEL-6625 - spring data neo4j example

* BAEL-6625 - spring data neo4j example

* BAEL-6625 - optimized imports

* BAEL-6625 - moving project to jdk9 and above

* BAEL-6625 - changing test names
  • Loading branch information
abh1navv authored Aug 13, 2023
1 parent 65ee0b0 commit 0323955
Show file tree
Hide file tree
Showing 24 changed files with 257 additions and 766 deletions.

This file was deleted.

56 changes: 21 additions & 35 deletions persistence-modules/spring-data-neo4j/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,53 +15,39 @@

<dependencies>
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-ogm-embedded-driver</artifactId>
<version>${neo4j-ogm.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-neo4j</artifactId>
<version>${spring-data-neo4j.version}</version>
<groupId>org.neo4j.test</groupId>
<artifactId>neo4j-harness</artifactId>
<version>${neo4j-harness.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.voodoodyne.jackson.jsog</groupId>
<artifactId>jackson-jsog</artifactId>
<version>${jackson-jsog.version}</version>
<scope>compile</scope>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-neo4j</artifactId>
<version>${spring-boot.version}</version>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<version>${spring-boot.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-ogm-test</artifactId>
<version>${neo4j-ogm.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.neo4j.test</groupId>
<artifactId>neo4j-harness</artifactId>
<version>${neo4j.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${spring-test.version}</version>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>

<properties>
<neo4j.version>3.4.6</neo4j.version>
<spring-data-neo4j.version>5.0.1.RELEASE</spring-data-neo4j.version>
<jackson-jsog.version>1.1</jackson-jsog.version>
<spring-boot.version>2.0.1.RELEASE</spring-boot.version>
<spring-test.version>5.0.1.RELEASE</spring-test.version>
<neo4j-ogm.version>3.1.2</neo4j-ogm.version>
<spring-boot.version>2.7.14</spring-boot.version>
<neo4j-harness.version>5.10.0</neo4j-harness.version>
</properties>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.baeldung.spring.data.neo4j;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class Neo4JApplication {

public static void main(String[] args) {
SpringApplication.run(Neo4JApplication.class, args);
}
}

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.baeldung.spring.data.neo4j.config;

import org.neo4j.cypherdsl.core.renderer.Dialect;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class Neo4jConfig {
@Bean
org.neo4j.cypherdsl.core.renderer.Configuration cypherDslConfiguration() {
return org.neo4j.cypherdsl.core.renderer.Configuration.newConfig()
.withDialect(Dialect.NEO4J_5).build();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
package com.baeldung.spring.data.neo4j.domain;


import org.springframework.data.neo4j.core.schema.Id;
import org.springframework.data.neo4j.core.schema.Node;
import org.springframework.data.neo4j.core.schema.Relationship;

import java.util.List;

@Node("Author")
public class Author {
@Id
private Long id;

private String name;

@Relationship(type = "WRITTEN_BY", direction = Relationship.Direction.INCOMING)
private List<Book> books;

public Author(Long id, String name) {
this.id = id;
this.name = name;
}

public Long getId() {
return id;
}

public void setId(Long id) {
this.id = id;
}

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

public List<Book> getBooks() {
return books;
}

public void setBooks(List<Book> books) {
this.books = books;
}
}
Loading

0 comments on commit 0323955

Please sign in to comment.