Giter VIP home page Giter VIP logo

jetbrains-exposed-orm's Introduction

Kotlin Jetbrains Exposed Orm With Java

logo

Summary

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.

๐Ÿ”จ Run the App

Maven

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

Used Dependencies

  • Java
  • Kotlin
  • Spring
    • Spring Boot 3
    • Spring Web
    • Spring JDBC
  • Jetbrains Exposed ORM
  • Postgres
  • PGAdmin
  • Maven
  • Docker
  • GraalVM CE Java 17-22.3.0
Codes

Initialize Models

model

Model Layer

model

Service Layer

service

Controller Layer

controller
Endpoints

Create a Customer

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 Customer by 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 Customer Orders by 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 All Customers

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 Customer by ID

DELETE /customers/{id}
Accept: application/json
Content-Type: application/json

{}
RESPONSE: HTTP 204 (No Content)
Location header: http://localhost:8080/customers/{id}

Update Customer by 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}

Resource

jetbrains-exposed-orm's People

Contributors

eukolos avatar

Stargazers

Ahmet Yasir Aksoy avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.