Hibernate memo at your disposal

Source: Internet
Author: User

Hibernate Memo Knowledge Points:

1, never manually modify the OID, because it will cause the data in the cache is not accurate

2. The Update method in the session interface is the solution to convert a Free state object into a persisted object

3, the session interface in the Saveorupdate method, if the transmission is instantaneous object, the execution of Save, if the incoming is a free object, the implementation of the Update method

4, if you are using lazy loading, and session.close () in the servlet has been executed, then get the child table data in the JSP will be error, this delay loading, lazy loading has said that the solution is after Session.close () plus   hibernate.initialize (user); The instantiation of the proxy class.


The concept of a proxy class in Hibernate is a class with only one OID, so when using lazy loading, the child table data in the list is all proxy classes.

Hibernate memo at your disposal

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.