Skip to content

Commit 856e7c9

Browse files
authored
Merge pull request #1 from bkuberek/jdbi
Migrate from hibernate to jdbi
2 parents 07efbc4 + af89947 commit 856e7c9

File tree

62 files changed

+2480
-753
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+2480
-753
lines changed

.idea/IntelliLang.xml

+13
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/sqldialects.xml

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/README.md

+33-39
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,48 @@
11
# Booking Service Demo
22

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

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

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

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

10-
1. [Requirements](./requirements.md)
11-
2. [Running the Application](./running.md)
12-
3. [Using the API](./api.md)
13-
4. [Notes](./notes.md)
11+
12+
## Documentation
13+
14+
1. [Problem](./problem.md)
15+
2. [Solution](./solution.md)
16+
3. [Running the Application](./running.md)
17+
4. [Using the API](./api.md)
18+
5. [Notes](./notes.md)
1419

1520

1621
## Project Scaffolding
1722

1823
This project was initialized using the command:
1924

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

24-
## Related Guides
25-
26-
- Kotlin ([guide](https://quarkus.io/guides/kotlin)): Write your services in Kotlin
27-
- 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
28-
- SmallRye GraphQL ([guide](https://quarkus.io/guides/smallrye-graphql)): Create GraphQL Endpoints using the code-first approach from MicroProfile GraphQL
29-
- JDBC Driver - PostgreSQL ([guide](https://quarkus.io/guides/datasource)): Connect to the PostgreSQL database via JDBC
30-
- 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
31-
- Liquibase ([guide](https://quarkus.io/guides/liquibase)): Handle your database schema migrations with Liquibase
32-
33-
34-
## Provided Code
35-
36-
### Hibernate ORM
37-
38-
Create your first JPA entity
39-
40-
[Related guide section...](https://quarkus.io/guides/hibernate-orm)
41-
42-
[Related Hibernate with Panache section...](https://quarkus.io/guides/hibernate-orm-panache)
43-
44-
### REST
45-
46-
Easily start your REST Web Services
47-
48-
[Related guide section...](https://quarkus.io/guides/getting-started-reactive#reactive-jax-rs-resources)
49-
50-
### SmallRye GraphQL
51-
52-
Start coding with this Hello GraphQL Query
53-
54-
[Related guide section...](https://quarkus.io/guides/smallrye-graphql)
29+
Quarkus Extensions
30+
31+
- `kotlin`
32+
- `rest-jackson`
33+
- `quarkus-smallrye-graphql`
34+
- `quarkus-jdbc-postgresql`
35+
- `quarkus-jdbi`
36+
- `quarkus-liquibase`
37+
38+
## References
39+
40+
- Quarkus ([guide](https://quarkus.io/)): Learn more about Quarkus, the Supersonic Subatomic Framework.
41+
- Kotlin ([guide](https://quarkus.io/guides/kotlin)): Write your services in Kotlin.
42+
- 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.
43+
- SmallRye GraphQL ([guide](https://quarkus.io/guides/smallrye-graphql)): Create GraphQL Endpoints using the code-first approach from MicroProfile GraphQL.
44+
- 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.
45+
- JDBC Driver - PostgreSQL ([guide](https://quarkus.io/guides/datasource)): Connect to the PostgreSQL database via JDBC.
46+
- Quarkus Jdbi ([guide](https://github.com/quarkiverse/quarkus-jdbi)): Makes it possible to use JDBI in native executables.
47+
- Jdbi ([guide](https://jdbi.org)): Provides convenient, idiomatic, access to relational data in Java.
48+
- Liquibase ([guide](https://quarkus.io/guides/liquibase)): Handle your database schema migrations with Liquibase.

docs/api.md

+26-16
Original file line numberDiff line numberDiff line change
@@ -67,26 +67,30 @@ Variables
6767
Mutation
6868

6969
```graphql
70-
mutation BookReservation(
71-
$request: ReservationRequestInput!,
72-
) {
70+
mutation CreateReservation($request: ReservationRequestInput!) {
7371
reservation: createReservation(reservationRequest: $request) {
74-
id
75-
name
76-
size
77-
restrictions
78-
restaurant {
72+
... on ReservationInfo {
7973
id
8074
name
81-
}
82-
tables {
8375
size
84-
quantity
76+
restrictions
77+
restaurant {
78+
id
79+
name
80+
}
81+
tables {
82+
size
83+
quantity
84+
}
85+
reservationTime
86+
createdTime
87+
updatedTime
88+
active
89+
}
90+
... on ReservationError {
91+
error
92+
message
8593
}
86-
reservationTime
87-
createdTime
88-
updatedTime
89-
active
9094
}
9195
}
9296
```
@@ -197,4 +201,10 @@ Variables
197201
{
198202
"id": "ae5a8791-43dc-4fee-a6c5-5d6be12344ed"
199203
}
200-
```
204+
```
205+
206+
207+
---
208+
209+
[<- Previous (Running the Application)](./running.md)
210+
| [Next (Notes) ->](./notes.md)

0 commit comments

Comments
 (0)