Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
128 views
in Technique[技术] by (71.8m points)

java - What does persistence object means in Hibernate architecture?

Hibernate is a persistence framework which is used to persist data from Java environment to database.

I am so confused.. if we persist an object to the database, then why does Hibernate Architecture depicts the persistent object in the middle of Application and Hibernate in the picture below?

a busy cat
(source: viralpatel.net)

question from:https://stackoverflow.com/questions/14025136/what-does-persistence-object-means-in-hibernate-architecture

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I will make it more clearer. Persistent objects are instances of POJO classes that you create that represent rows in the table in the database. According to hibernate-doc an instance of POJO class representing table in database goes through 3 states of which persistent is one of them.

When a POJO instance is in session scope, it is said to be persistent i.e hibernate detects any changes made to that object and synchronizes it with database when we close or flush the session.

And about hibernate.properties and XML Mapping @Ken Chan is right. Go through hibernate-doc for more illustrations on objects in hibernate.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...