Giter Club home page Giter Club logo

spring-boot-jpa-oracle-project's Introduction

Spring Boot + Spring Data JPA + Oracle

Spring Boot project example.

Restful Pattern:
POST 	/api/cars		Create
GET 	/api/cars		Get all
GET 	/api/cars/{id}		Get car by id
PUT 	/api/cars/{id}		Update car by id
DELETE 	/api/cars/{id}		Delete car by id
เครื่องมือที่ใช้:
  1. Spring boot 1.5.8.RELEASE
  2. Java 8
  3. Oracle database 11g express
  4. Oracle JDBC driver ojdbc7.jar
  5. Lombok
  6. Maven
  7. Hibernate Core 5.0.12.Final
Project Run test:
...
2561-03-28 11:16:07 INFO  o.s.o.j.LocalContainerEntityManagerFactoryBean - Initialized JPA EntityManagerFactory for persistence unit 'default'
2561-03-28 11:16:08 INFO  o.s.w.s.m.m.a.RequestMappingHandlerAdapter - Looking for @ControllerAdvice: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@1c72da34: startup date [Wed Mar 28 11:16:02 ICT 2018]; root of context hierarchy
2561-03-28 11:16:08 INFO  o.s.w.s.m.m.a.RequestMappingHandlerMapping - Mapped "{[/api/cars/{id}],methods=[PUT]}" onto public org.springframework.http.ResponseEntity<java.lang.Void> com.bamossza.project.controller.CarController.update(int,com.bamossza.project.entities.Car)
2561-03-28 11:16:08 INFO  o.s.w.s.m.m.a.RequestMappingHandlerMapping - Mapped "{[/api/cars/{id}],methods=[DELETE]}" onto public org.springframework.http.ResponseEntity<java.lang.Void> com.bamossza.project.controller.CarController.delete(int)
2561-03-28 11:16:08 INFO  o.s.w.s.m.m.a.RequestMappingHandlerMapping - Mapped "{[/api/cars],methods=[POST]}" onto public org.springframework.http.ResponseEntity<java.lang.Void> com.bamossza.project.controller.CarController.create(com.bamossza.project.entities.Car)
2561-03-28 11:16:08 INFO  o.s.w.s.m.m.a.RequestMappingHandlerMapping - Mapped "{[/api/cars/{id}],methods=[GET]}" onto public org.springframework.http.ResponseEntity<com.bamossza.project.entities.Car> com.bamossza.project.controller.CarController.getById(int)
2561-03-28 11:16:08 INFO  o.s.w.s.m.m.a.RequestMappingHandlerMapping - Mapped "{[/api/cars],methods=[GET]}" onto public org.springframework.http.ResponseEntity<java.util.List<java.util.Map<java.lang.String, java.lang.Object>>> com.bamossza.project.controller.CarController.getAll()

After run auto create database:

Image of runtest

CREATE:
POST /api/cars
{
	"carBrand": "MAZDA",
    "carModel": "SKYACTIV-G 2.0",
    "horsepower": "165",
    "carEngine": "2000"
}

Image of runtest

GET ALL:
GET /api/cars

Image of runtest

GET BY ID:
GET /api/cars/1

Image of runtest

UPDATE:
PUT /api/cars/1
{
	"carBrand": "TOYOTA",
    "carModel": "Corolla Altis",
    "horsepower": "110",
    "carEngine": "1600"
}

Image of runtest

DELETE:
DELETE /api/cars/1

Image of runtest

Website

Medium Blog

By. Panusit Khuenkham (bamossza)

spring-boot-jpa-oracle-project's People

Contributors

bamossza avatar

Watchers

Kris Rott avatar James Cloos avatar  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.