What is persistence in sleep mode?

I read the basics of ORM from here , where it is defined, what is persistence?

here it is defined as

we would like the state (some of) of our objects to go beyond the JVM, so that the same state is available later.

I could not understand what this means that is beyond the scope of the JVM . what i understood it could be

  • object is not processed by jvm but SESSION
  • we can save the state of objects using a level 2 cache.

Please correct me, because, in truth, I did not understand this statement, which is defined on the Hibernates official website.

+4
source share
3 answers

beyond the scope of the JVM , JVM. , , JVM. Hibernate - ORM ( ), Java . Hibernate Java- .

Person:

public class Person {
    private String firstName;
    private String lastName;

    public Person(String firstName, String lastName) {
        this.firstName = firstName;
        this.lastName = lastName;
    }

    // getters and setters
}

, 2 Person , :

Person p1 = new Person("Jon", "Skeet");
Person p2 = new Person("Gordon", "Linoff");

Person Hibernate, Person, :

+-----------+----------+
| firstName | lastName |
+-----------+----------+
| Jon       | Skeet    |
| Gordon    | Linoff   |
+-----------+----------+

Java , Hibernate Person .

+4

, . , . - .

, .

JVM , , JVM , .

Hibernate Java bean/ . ORM Object to Relational Mapping framework. , , .

+2

this means that the data will be stored somewhere like a file or database, even when your application is closed, so next time you can use the data again

+1
source

All Articles