Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 9 additions & 11 deletions asciidoc/courses/app-java/course.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
:categories: developer:2, java:1, software-development:12, intermediate:12, , development:3
:usecase: recommendations
:status: active
:caption: Learn how to interact with Neo4j from Java using the Neo4j Java Driver
:caption: Learn how to build Java applications with Neo4j using the Neo4j Java Driver
:key-points: Driver life cycle, installing and instantiation, read and write transactions, best practices
// tag::config[]
:repository: neo4j-graphacademy/app-java
Expand All @@ -19,20 +19,18 @@ You will learn the skills you need to build applications with Java to read data

=== Prerequisites

Taking this course, you should have the following previous knowledge/skills:
By taking this course, we assume that you have a working knowledge of Java and how to build applications.
We also assume that you have at least a basic knowledge of Neo4j.

1. Be able to write Java programs.
2. Have completed the link:/courses/neo4j-fundamentals/[Neo4j Fundamentals] and link:/courses/cypher-fundamentals/[Cypher Fundamentals] courses.

include::{shared}/courses/gitpod/overview.adoc[leveloffset=+1]
If you haven't already done so, we recommend that you also take the link:/courses/neo4j-fundamentals/[Neo4j Fundamentals] course in order to gain a basic understanding of Neo4j, the link:/courses/cypher-fundamentals/[Cypher Fundamentals] to understand how to query Neo4j using Cypher, and the link:/courses/drivers-java/[Using Neo4j with Java] course to understand how to integrate Neo4j into your Java projects.

=== Duration

4 hours

=== What you will learn

* How to use the Neo4j with Java
* How to use Neo4j with Java
* How to map a graph data model to a Java application domain model
* How to convert between Neo4j and Java data type systems
* How to read data from and write data to Neo4j
Expand All @@ -44,7 +42,7 @@ include::{shared}/courses/gitpod/overview.adoc[leveloffset=+1]

[.includes]
== This course includes
//TODO: Update this!!
* [lessons]#8 lessons#
* [challenges]#15 short hands-on challenges#
* [quizes]#20 simple quizzes to support your learning#

* [lessons]#Lessons for understanding concepts and syntax#
* [challenges]#Hands-on challenges for practical application#
* [quizes]#Quizzes to support your learning#
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
= Setup
:type: lesson
:disable-cache: true
:slides: true
:order: 1
:minutes: 10
:branch: main

To experiment with Neo4j and Java during this course you will need to setup a development environment.

include::../../../../../../shared/courses/codespace/get-started.adoc[]

The repository contains an example Maven project with the required dependencies and a `pom.xml` file.

[%collapsible]
.Develop on your local machine
====
You will need link:https://www.java.com[Java] 17 or higher installed.
You can check your version by running `java -version`.
To download Java, you can choose from many link:https://neo4j.com/docs/operations-manual/current/installation/requirements/#deployment-requirements-software[supported vendor options^]. For example, link:https://www.azul.com/downloads/?package=jdk#zulu[Azul's JDK^] or hlink:ttps://openjdk.org/install/[OpenJDK^].

Clone the link:{repository-link}[github.com/neo4j-graphacademy/app-java] repository:

[source,bash]
----
git clone https://github.com/neo4j-graphacademy/app-java
----

[TIP]
.Fork the repository
You can link:https://github.com/neo4j-graphacademy/app-java/fork[fork the repository] and have a copy for future reference.

Install the project and dependencies using Maven:

[source,bash]
----
cd app-java
./mvnw clean install -U -DskipTests
----

You do not need to create a Neo4j database as you will use the provided sandbox instance.
====

== Driver installation

The Neo4j driver is included in the `pom.xml` file, so you do not need to install it separately.

[source, xml]
----
include::{repository-raw}/{branch}/pom.xml[tag=neo4j-driver]
----

[%collapsible]
.Click to view the complete pom.xml file
====
[source, xml]
----
include::{repository-raw}/{branch}/pom.xml[tag=**]
----
====

== Setup the environment

Create a new `/src/main/resources/application.properties` file and copy the contents of the `example.properties` file into it.

Fill in the required values:

[source]
.Create a resources/application.properties file
----
include::{repository-raw}/{branch}/src/main/resources/example.properties[]
----

Update the Neo4j sandbox connection details:

NEO4J_URI:: [copy]#bolt://{sandbox-ip}:{sandbox-boltPort}#
NEO4J_USERNAME:: [copy]#{sandbox-username}#
NEO4J_PASSWORD:: [copy]#{sandbox-password}#

== Test your setup

You can test your setup by running the test - `src/test/java/neoflix/_01_ConnectToNeo4jTest.java`.

The test will attempt to load the values in the `application.properties` file and connect to the Neo4j sandbox.

[source,bash]
----
./mvnw test
----

You will see `Tests run: 2, Failures: 0, Errors: 0, Skipped: 0` and a `BUILD SUCCESS` message if you have set up your environment correctly.

If any tests fail, check the contents of the `application.properties` file.

== Continue

When you are ready, you can move on to the next task.

read::Success - let's get started![]

[.summary]
== Summary

You have setup your environment and are ready to start this module.
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
:order: 2
:type: lesson
:sandbox: true
//FIX below properties!
:lab: {repository-blob}/src/{lab-file}
:lab-file: test/java/com/example/appjava
:lab-filename: AppJavaApplicationTests.java
:disable-cache: true

To connect to the Neo4j database, you will need to set a few configuration properties.
Expand Down Expand Up @@ -51,10 +47,10 @@ read::Success[]

[.summary]
== Lesson Summary
//TODO: Fix this when content is complete!

In this lesson, you added connection details to your application and tested the connection to the Neo4j database. This lesson completes Module 1 of the course.

In the next module, you will learn about mapping the graph data model to the application domain model.
In the next module, you will refresh concepts for interacting with Neo4j using the Neo4j Java driver and then apply these concepts in your application.

=== Further Reading

Expand Down

This file was deleted.

Loading