my entity class trying to implement for stocks.java
@Entity @Table(name="stocks") public Class Stocks { @Id @GeneratedValue @Column(name = "stock_id") private Integer stocked; } this my rest API controller I wrote stockcontroller.java
@RestController @RequestMapping("home/stocks") public class HomeController { @Autowired private StockRepo stocks; //POST: adds a new song to the repository @PostMapping("/add") public void addSong(@RequestBody(required = true) Stock stock) throws DuplicateItemException { if(stock.existsById(stock.stockId())) { throw new DuplicateItemException(); } stocks.save(song); } }