I try to create a Student entity in java using JPA, but something not work.
I have a table in postgresql named "Studenti" and class Student
My student class is:
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
@Entity(name = "Student")
@Table(name = "Studenti")
public class Student implements Serializable {
@Id
@Column(name = "Id")
private long Id;
@Column(name = "Nume")
private String firstName;
@Column(name = "Prenume")
private String lastName;
@Column(name = "An")
private int year;
@Column(name = "Id_cont")
private long accountId;
}
And the table has the following structure:
Application.properties:
server.port=9091
spring.application.name=user-management
spring.datasource.url=jdbc:postgresql://localhost:5432/Licenta
spring.datasource.username=postgres
spring.datasource.password=*****
spring.jpa.properties.hibernate.temp.use_jdbc_metadata_defaults=false
spring.jpa.database-platform=org.hibernate.dialect.PostgreSQL9Dialect
spring.jpa.hibernate.ddl-auto=update
spring.h2.console.enabled=true
Need to crete a special file with setting for this or something else ?

uuidis not along. I would suspect that this is the problem. Can you please include the stack trace you encounter?