Compare commits

..

No commits in common. '8cf2fb1e85bd72beb67bea32ea8d093152ee2d5d' and 'acbcee46f1f2a8707b00fef31598e33345d28200' have entirely different histories.

@ -1,4 +1,4 @@
# spring-rest-example
# jpa-hospital-example
This project is a example of using jpa.
@ -10,6 +10,43 @@ The project uses the [Spock Framework Example Project](https://github.com/spockf
- Maven use `mvnw` wrapper
- Gradle use `gradlew` wrapper
## Building with Gradle
Downloaded files (including the Gradle distribution itself) will be stored in the Gradle user home directory (typically **user_home**`/.gradle`).
Type: test
```shell
./gradlew clean test
```
Type: build
```shell
./gradlew clean build
```
Type: preparation
- create a folder, for example, `project`.
- copy `jpa_hospital_example-2.0.1.jar` from a release to the folder.
- if you build the application from source, find the file (`jpa_hospital_example-2.0.1-all.jar`) in `build/libs/`.
- copy docker/docker-compose.yml to the folder.
- turn up the database in the `project/docker`:
```
docker-compose up -d
```
- wait a minute while the database is bootstrapping.
- now you can connect with the application.
Type: run
After the preparation, run the application in the folder, for example, `project`:
```shell
java -jar jpa_hospital_example-2.0.1.jar
```
## Building with Maven
Downloaded files will be stored in the local Maven repository (typically **user_home**`/.m2/repository`).
@ -29,7 +66,7 @@ Type: build
Type: preparation
- create a folder, for example, `project`.
- copy `spring_rest_example-version.jar` from a release to the folder.
- copy `jpa_hospital_example-version.jar` from a release to the folder.
- if you build the application from source, find the file in `target/`.
- copy docker/docker-compose.yml to the folder.
- turn up the database in the `project/docker`:
@ -43,7 +80,7 @@ Type: run
After the preparation, run the application in the folder, for example, `project`:
```shell
java -jar spring_rest_example-2.0.1.jar
java -jar jpa_hospital_example-2.0.1.jar
```
## Author

@ -0,0 +1,15 @@
package space.kklochko.jpa_hospital_example;
import jakarta.persistence.EntityManager;
import space.kklochko.jpa_hospital_example.cli.CLI;
import space.kklochko.jpa_hospital_example.db.factories.EntityManagerConnection;
public class Main {
public static void main(String[] args) {
EntityManager manager = (new EntityManagerConnection("jpa_hospital_example")).connect();
CLI cli = new CLI(manager);
cli.run();
}
}
Loading…
Cancel
Save