这篇文章是关于Hibernate的三个Life cycle state的总结。 了解清楚会对hibernate的工作原理有很好的认识。
any instance of object only can be three states:
- Transient
- persistent
- detached
Transient :
Hibernate not manage transient object.
In transient state, POJO is communication with the client code only, no any connection with database
Persistent
in Persistent state, a Session object created to manage the persistence of the Java object and database,
change of both side will keep up-to-date.