How to get the value which being saved to database after
entityManager.persist
I am able to get the primary key value from database after calling persist not any other values. E.g.
public void create(Project project) {
entityManager.persist(project);
System.out.println("Id -- " + project.getProjectId());
System.out.println("no -- " + project.getProjectNo());
}
From the above code I am able to get the newly inserted value from project.getProjectId
, however not able to get project.getProjectNo
The reason why I am able to get projectId
is because it is primary key?
How can I get the value of getProjectNo
after persist?