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

Migrate from hibernate to jdbi #1

Merged
merged 7 commits into from
Aug 5, 2024
Merged
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
13 changes: 13 additions & 0 deletions .idea/IntelliLang.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions .idea/sqldialects.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

72 changes: 33 additions & 39 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,54 +1,48 @@
# Booking Service Demo

This project uses Kotlin and Quarkus, the Supersonic Subatomic Framework.
This project is intended for demonstration purposes. It proposes a [Solution](./solution.md) to an example [Problem](./problem.md).

If you want to learn more about Quarkus, please visit its website: <https://quarkus.io/>.
The application is a GraphQL API writen in Kotlin and Quarkus. It uses Postgres for persistence.

To learn more about this project and try it out, continue reading.

## Table of Contents
Thank you for your interest. Feel free to add questions, comments and suggestions [here](https://github.com/bkuberek/kotlin-quarkus-booking-service-demo/issues).

1. [Requirements](./requirements.md)
2. [Running the Application](./running.md)
3. [Using the API](./api.md)
4. [Notes](./notes.md)

## Documentation

1. [Problem](./problem.md)
2. [Solution](./solution.md)
3. [Running the Application](./running.md)
4. [Using the API](./api.md)
5. [Notes](./notes.md)


## Project Scaffolding

This project was initialized using the command:

```shell
quarkus create app com.nelo:reservations-service --extension='kotlin,rest-jackson,quarkus-smallrye-graphql,quarkus-jdbc-postgresql,quarkus-hibernate-orm-panache,quarkus-liquibase'
quarkus create app com.bkuberek:booking-service --extension='kotlin,rest-jackson,quarkus-smallrye-graphql,quarkus-jdbc-postgresql,quarkus-jdbi,quarkus-liquibase'
```

## Related Guides

- Kotlin ([guide](https://quarkus.io/guides/kotlin)): Write your services in Kotlin
- REST Jackson ([guide](https://quarkus.io/guides/rest#json-serialisation)): Jackson serialization support for Quarkus REST. This extension is not compatible with the quarkus-resteasy extension, or any of the extensions that depend on it
- SmallRye GraphQL ([guide](https://quarkus.io/guides/smallrye-graphql)): Create GraphQL Endpoints using the code-first approach from MicroProfile GraphQL
- JDBC Driver - PostgreSQL ([guide](https://quarkus.io/guides/datasource)): Connect to the PostgreSQL database via JDBC
- Hibernate ORM with Panache ([guide](https://quarkus.io/guides/hibernate-orm-panache)): Simplify your persistence code for Hibernate ORM via the active record or the repository pattern
- Liquibase ([guide](https://quarkus.io/guides/liquibase)): Handle your database schema migrations with Liquibase


## Provided Code

### Hibernate ORM

Create your first JPA entity

[Related guide section...](https://quarkus.io/guides/hibernate-orm)

[Related Hibernate with Panache section...](https://quarkus.io/guides/hibernate-orm-panache)

### REST

Easily start your REST Web Services

[Related guide section...](https://quarkus.io/guides/getting-started-reactive#reactive-jax-rs-resources)

### SmallRye GraphQL

Start coding with this Hello GraphQL Query

[Related guide section...](https://quarkus.io/guides/smallrye-graphql)
Quarkus Extensions

- `kotlin`
- `rest-jackson`
- `quarkus-smallrye-graphql`
- `quarkus-jdbc-postgresql`
- `quarkus-jdbi`
- `quarkus-liquibase`

## References

- Quarkus ([guide](https://quarkus.io/)): Learn more about Quarkus, the Supersonic Subatomic Framework.
- Kotlin ([guide](https://quarkus.io/guides/kotlin)): Write your services in Kotlin.
- REST Jackson ([guide](https://quarkus.io/guides/rest#json-serialisation)): Jackson serialization support for Quarkus REST. This extension is not compatible with the quarkus-resteasy extension, or any of the extensions that depend on it.
- SmallRye GraphQL ([guide](https://quarkus.io/guides/smallrye-graphql)): Create GraphQL Endpoints using the code-first approach from MicroProfile GraphQL.
- GraphQL Kotlin ([guide](https://opensource.expediagroup.com/graphql-kotlin/docs/schema-generator/writing-schemas/unions)): **Not a quarkus example** (sprint boot), but it is a good reference for implementing graphql on kotlin.
- JDBC Driver - PostgreSQL ([guide](https://quarkus.io/guides/datasource)): Connect to the PostgreSQL database via JDBC.
- Quarkus Jdbi ([guide](https://github.com/quarkiverse/quarkus-jdbi)): Makes it possible to use JDBI in native executables.
- Jdbi ([guide](https://jdbi.org)): Provides convenient, idiomatic, access to relational data in Java.
- Liquibase ([guide](https://quarkus.io/guides/liquibase)): Handle your database schema migrations with Liquibase.
42 changes: 26 additions & 16 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,26 +67,30 @@ Variables
Mutation

```graphql
mutation BookReservation(
$request: ReservationRequestInput!,
) {
mutation CreateReservation($request: ReservationRequestInput!) {
reservation: createReservation(reservationRequest: $request) {
id
name
size
restrictions
restaurant {
... on ReservationInfo {
id
name
}
tables {
size
quantity
restrictions
restaurant {
id
name
}
tables {
size
quantity
}
reservationTime
createdTime
updatedTime
active
}
... on ReservationError {
error
message
}
reservationTime
createdTime
updatedTime
active
}
}
```
Expand Down Expand Up @@ -197,4 +201,10 @@ Variables
{
"id": "ae5a8791-43dc-4fee-a6c5-5d6be12344ed"
}
```
```


---

[<- Previous (Running the Application)](./running.md)
| [Next (Notes) ->](./notes.md)
Loading