This project is a simple example of how to use the Jetbrains Exposed ORM with Kotlin and Java. The project is a simple REST API that allows you to create, read, update, and delete customers.
1 ) Download your project from this link shown below
git clone https://github.com/Eukolos/jetbrains-exposed-orm.git
2 ) Go to the project's home directory shown below
cd jetbrains-exposed-orm
3 ) Create native image though this command shown below
mvn -Pnative spring-boot:build-image
4 ) Run the project though this command shown below
docker-compose up
- Java
- Kotlin
- Spring
- Spring Boot 3
- Spring Web
- Spring JDBC
- Jetbrains Exposed ORM
- Postgres
- PGAdmin
- Maven
- Docker
- GraalVM CE Java 17-22.3.0
Endpoints
POST /customers
Accept: application/json
Content-Type: application/json
{
"name": "John Doe",
"city": "New York"
}
RESPONSE: HTTP 201 (Created)
Location header: http://localhost:8080/customers/{id}
GET /customers/{id}
Accept: application/json
Content-Type: application/json
{
"name": "John Doe",
"city": "New York"
}
RESPONSE: HTTP 200 (OK)
Content: "application/json"
Location header: http://localhost:8080/customers/{id}
GET /customers/orders/{id}
Accept: application/json
Content-Type: application/json
{
"name": "John Doe",
"city": "New York",
"orders": ["Order1", "Order2"]
}
RESPONSE: HTTP 200 (OK)
Content: "application/json"
Location header: http://localhost:8080/customers/orders/{id}
GET /customers
Accept: application/json
Content-Type: application/json
[
{
"name": "John Doe",
"city": "New York"
},
{
"name": "Jane Doe",
"city": "Los Angeles"
}
]
RESPONSE: HTTP 200 (OK)
Content: "application/json"
Location header: http://localhost:8080/customers
DELETE /customers/{id}
Accept: application/json
Content-Type: application/json
{}
RESPONSE: HTTP 204 (No Content)
Location header: http://localhost:8080/customers/{id}
PUT /customers/{id}
Accept: application/json
Content-Type: application/json
{
"name": "Updated Name",
"city": "Updated City",
}
RESPONSE: HTTP 200 (OK)
Location header: http://localhost:8080/customers/{id}