Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JPA - What exactly does it mean for an entity object to persist? What is the definition of persistence?

I'm fairly new to java web applications and I am undertaking the task of learning JPA. However, it is not explicitly clear what it means for an entity object to persist. I think I have an idea, but I would rather not assume its meaning.

I am referencing the Oracle JPA Doc, but they continue to use the words like "persist" or "persistence" when describing persistent fields/properties. Can someone shed some light on this idea of persistence? And maybe define what it means for an instance of an entity to be persistent?

And if you could not use the word "persistent" (or any form of the word) in your definition that would be much appreciated. A simple answer would be great, but more in-depth explanations are definitely welcome! Thanks so much!

like image 679
heez Avatar asked Dec 22 '14 18:12

heez


People also ask

What is persistence in JPA?

Persistence simply means to Store Permanently. In JAVA we work with Objects and try to store Object's values into database (RDBMS mostly). JPA provides implementation for Object Relation Mapping (ORM) ,so that we can directly store Object into Database as a new Tuple. Object, in JPA, are converted to Entity for mapping it to the Table in Database.

What is the Java Persistence API?

The Java persistence API is a specification for persistence, which loosely means any method through which Java objects overlive their application process. It is not necessary to persist all Java objects, but most applications continue to have key business objects.

What is the use of JPA in Java?

JPA stands for the Java persistence API. The Java persistence API is a specification for persistence, which loosely means any method through which Java objects overlive their application process. It is not necessary to persist all Java objects, but most applications continue to have key business objects.

Do all Java objects need to be persisted?

Not all Java objects need to be persisted, but most applications persist key business objects. The JPA specification lets you define which objects should be persisted, and how they are persisted in your Java applications. By itself, JPA is not a tool or framework; rather, it defines a set of concepts that guide implementers.


1 Answers

  • Persistence simply means to Store Permanently.

    • In JAVA we work with Objects and try to store Object's values into database(RDBMS mostly).
    • JPA provides implementation for Object Relation Mapping(ORM) ,so that we can directly store Object into Database as a new Tuple.
    • Object, in JPA, are converted to Entity for mapping it to the Table in Database.
  • So Persisting an Entity means Permanently Storing Object(Entity) into Database.

Hope this Helps!!

like image 200
Shabbir Essaji Avatar answered Sep 28 '22 07:09

Shabbir Essaji