1
What’s the difference when I declare a class informing the
@GeneratedValue(strategy = GenerationType.IDENTITY
) and not informing, since the database manager will coordinate the primary key?
I’m asking because informing or not, created the tables in the same way.
@Entity
public class Status implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name="status_id")
private Long id;
@Column(name="status_descricao")
private String descricao;**
I realized this. At the time of testing with Postman, if there is no @Generatedvalue annotation, the data is not entered in the database. Then put this note when I send a POST via Postman it can write to the database. Thank you very much
– Josemar Sabino