Wednesday, 28 February 2018

Spring Boot JPA

Spring Boot JPA 

In 5 Simple Steps Integrate PostgreSQL Database | Tuorial - 4


Hello Friends, Welcome to Spring Boot JPA tutorial.

In this tutorial of Spring Boot JPA we are going to integrate  PostgreSQL database in 5 simple steps with Account Spring Boot Restful Web Service that we have created in our previous Spring Boot tutorial.

 

FIVE STEPS

STEP - 1

Adding Spring Boot JPA and PostgreSQL driver class dependency in build.gradle

STEP - 2 

Adding properties releated to Spring Boot JPA & PostgreSQL database in application.properties

STEP - 3

Converting Account domain to Account entity using Spring Boot JPA annotations

STEP - 4 

Implementing Spring Boot JPA Repository

STEP - 5

Adding support of Spring Boot JPA Repository in Service class

Spring Data JPA

  1. Spring data JPA does a integration between  Spring Application & JPA.
  2. JPA stands for JAVA Persistent API
  3. JPA is a collection of method & classes to persist data in database
  4. JPA forms a bridge between the Object Model (POJO) & Relational Model (Database Table)

Step-1: Adding Dependencies

Step-2: Adding Properties

Step-3:  Implementing JPA Entity

Step-4: Implementing Spring Boot JPA Repository

Step-5: Adding support of JPA repository in Service


For more details please check out following videos:
1. Restful Web Service Tutorial - https://goo.gl/7evDWv

2. Spring Boot Restful Web Service Tutorial - https://goo.gl/3F8W5g

Tuesday, 20 February 2018

Spring boot CRUD Operations example PUT & DELETE | Tutorial - 3

Spring boot CRUD Operations example 
PUT & DELETE



Welcome to spring boot restful web service tutorial, Tutorial -3 Spring boot CRUD Operations example PUT & DELETE.

In today's spring boot crud operations example we will learn following:

1. How to implement spring boot crud operations for sample Accounts spring boot restful web service.

2. As part of spring boot crud operations example tutorial we will learn implementation of PUT & DELETE methods.

3. We will also cover some corner use cases as part of this spring boot crud operations example tutorial.

In previous spring boot restful web service tutorial we have learned following:

1. How to implement spring boot crud operations example for sample Account spring boot restful web service.

2. In that spring boot crud operations example tutorial we have learn implementation of GET & POST method.

Content of this spring boot crud operations example tutorial is are as follows:

1. Implementation of spring boot service methods for PUT & DELETE methods
2. Implementation of spring boot crud operations methods in spring boot restful controller
3. Handling some corner use cases in spring boot crud operations example
4. Demo using CURL commands

spring boot CRUD operations means implementing CRUD operations using spring boot. Spring boot CRUD operations involves different operations such as create, read, update & delete. With respect to this different spring boot crud operations there are different HTTP methods such as POST, GET, PUT & DELETE.

For more details please check out following videos:

Implementation of spring boot service methods for PUT & DELETE methods
 
Implementation of spring boot crud operations methods in spring boot restful controller
 
CURL Commands
 

Saturday, 17 February 2018

Spring Boot Restful Web Services CRUD Example GET & POST | Tutorial - 2

Spring Boot Restful Web Services CRUD Example GET & POST



Welcome to spring boot restful web services crud example tutorial.

In this spring boot restful web services crud example tutorial we will learn following:

1. How to implement spring boot crud operations example for sample Account spring boot restful web service.

2. As part of spring boot restful web services crud example we will learn implementation of GET & POST methods.

In previous spring boot restful web services crud example tutorial we have learned following:

1. How to create spring boot restful web services example project using spring tool suite.

2. How to implement a basic spring boot restful web services crud example for sample Account spring boot restful web service.

In this spring boot restful web services crud example tutorial we will learn about GET & POST method implementation. And also about different spring boot annotations.

Content of this spring boot restful web services crud example tutorial is are as follows:

1. Implementing a spring boot restful web services crud example domain
2. Implementing a spring boot restful web services crud example service
3. Implementing a spring boot restful web services crud example controller
4. CURL commands for GET & POST

spring boot CRUD operations means implementing CRUD operations using spring boot. Spring boot CRUD operations involves different operations such as create, read, update & delete. With respect to this different spring boot crud operations there are different HTTP methods such as POST, GET, PUT & DELETE.

For more details please check out following videos:
Implementing a spring boot restful web services crud example domain

Implementing a spring boot restful web services crud example service

Implementing a spring boot restful web services crud example controller

CURL commands for GET & POST

Saturday, 3 February 2018

Spring Boot Restful Web Service Tutorial | Tutorial 1 - Introduction

 

Spring Boot Restful Web Service Tutorial - Introduction

 In this session we will cover following:
  • Implementing GET Request for Accounts Restful Web Service
  • Discuss annotations & entity

Implementation 

Application Class

 

Controller Class


Annotation & Entity

  1. @RestController
  2. @SpringBootApplication
  3. @RequestMapping
  4. ResponseEntity

Friday, 19 January 2018

REST Vs SOAP



SOAP is a protocol whereas REST is architecture.

SOAP exposes behavior which represent logic whereas REST exposes resources which represent data.
 
In terms of consumption REST service is much simpler than SOAP. With REST overhead of handling XML envelops is eliminated which makes it more fast as
compare to SOAP.

 
SOAP provided good security options as compared to REST.
 
For machine to machine interaction & enterprise solutions SOAP is preferable but for public facing API’s REST is best option almost 70% public API’s are REST.
 
REST is lightweight, maintainable & scalable.
 
REST is device independent i.e. client consuming REST API can be anything like Mobile devices, Notebooks, TV etc.
 
With the cloud coming in action. Application is slowly moving to cloud based systems such as Azure, Amazon AWS. These systems are build and exposing REST API’s. Hence it is a good moveto build application on the top of the REST API.

Restful Web Service - Quick Introduction




Introduction

REST (Representational State Transfer) architecture uses HTTP protocol for data communication.
REST is introduced by Roy Fielding in 2000.

RESTful web services are resources on the web and you are allowed to perform certain actions (HTTP Methods) over it.

Resource in REST is identified by URI’s and representation of state is in the form of XML, JSON
etc.
 

Resource in REST can be anything like Text file, HTML Page, Images, Video or dynamic business
data.


Key elements
1. Resource
2. Request Verbs (GET, POST, PUT & DELETE)
3. Request Header & Body
4. Response Header & Body
5. Response Status Code


Characteristics
1. Client Server architecture
2. Stateless (In case of maintaining the client interaction extra information needs to be
send) [Independent Question Answer]
3. Cache


Commonly used HTTP Methods
1. GET
2. POST
3. PUT
4. DELETE
5. OPTIONS


Address format 
<protocol>://<service_name>/<resource_type>/<resource_id>
 
1. Use plural nouns e.g. customers
2. Instead of “ ” use “_” or “-” for big names
3. Use lower case letters
4. Maintain the backward compatibility i.e. when new version is releases use the response
code 300 for redirect

Spring Boot JPA

Spring Boot JPA  In 5 Simple Steps Integrate PostgreSQL Database | Tuorial - 4 Hello Friends, Welcome to Spring Boot JPA tutorial...