Javatpoint Logo
Javatpoint Logo

Update an Entity

JPA allows us to change the records in database by updating an entity.

JPA Entity Update Example

Here, we will update the age of a student on the basis of primary key.

This example contains the following steps: -

  • Create an entity class named as under com.javatpoint.jpa.student package that contains attributes s_id, s_name and s_age.

  • Now, map the entity class and other databases confiuguration in Persistence.xml file.


  • Create a persistence class named as under com.javatpoint.jpa.update package to persist the entity object with data.


JPA Update an Entity

Youtube For Videos Join Our Youtube Channel: Join Now


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Trending Technologies

B.Tech / MCA