| Start |
|---|
| Spring boot rest controller. In this example i will show how to formulate an rest controller to get and post data to the database using JPA with the most ease and least code. In this example we will refer to the data table named buyerRequirement . BuyingRequirement.java @Entity @Table(name = "BUYINGREQUIREMENTS") @NamedQueries({ @NamedQuery(name = "BuyingRequirement.findAll", query = "SELECT b FROM BuyingRequirement b")}) public class BuyingRequirement extends Domain implements Serializable { private static final long serialVersionUID = 1L; } This is the entity class which includes the parameter referring to columns in byuingRequirement table and their getters and setters. IBuyingRequirementsRepository.java(JPA interface) BuyingRequirementController.java It includes there method
|
Read Article
https://develop.horje.com/learn/1434/reference