79528765

Date: 2025-03-23 10:08:35
Score: 2.5
Natty:
Report link

Since your id is auto-generated in Account.java, you should not pass it manually in Postman.

Why? Your entity is defined as:

@Id

@GeneratedValue(strategy = GenerationType.IDENTITY)

private Long id;

How to Fix It?

Correct JSON request (without id):

{ "accountHolderName": "Piyush", "balance": 1000.00 }

This allows Spring Boot and JPA to handle id generation.

Possible Issues If You Pass id Manually

  1. Spring Boot might not bind the request properly, leading to 404 Not Found.

  2. JPA may throw an error if it expects an auto-generated value but receives one manually.

  3. If your database is empty, id = 1 does not exist, causing your GET requests to fail.

Reasons:
  • Blacklisted phrase (0.5): Why?
  • RegEx Blacklisted phrase (1.5): How to Fix It?
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Low reputation (1):
Posted by: Pushpendra gour