In hibernate, at org. hibernate. tuple. abstractentitytuplizer. createproxy (abstractentitytuplizer. Java: 372)

Source: Internet
Author: User

1: The problem lies in cglib. You can fix the problem and update cglib from 2.1.3 To 2.2.beta1 using hibernate3.1.
2: set lazy = "false" for the relevant table to solve the problem.

In general, it is delayed loading. There is no problem when writing the test class, but an error occurs when the application is applied to the web page. Or upgrade the hibernate version to correct this error.

Related: hibernate lazy fetch

1. Fetch has a higher priority than lazy. In general cases (except in general cases, as described in the next article) Fetch has a higher priority than lazy. In case of fetch, lazy is ignored.

2. In the configuration file, lazy must be explicitly declared as false or true. In the case of multiple pairs, lazy is neither true nor false by default. If you do not explicitly state that it is executed in the lazy = true method, but if you explicitly write lazy = true, an error is returned, in general, lazy = false is clearly written.

3. YourCodeIf student = (student) session. get (student. class, 1), Hibernate will correctly execute according to the configuration file policy, fetch is executed when fetch is available, and lazy is executed when lazy is available; but if your code is like Query query = session. createquery ("from student"), which ignores the fetch in the configuration file, does not execute fetch = join, lazy is correctly executed, and student attributes (this is assumed to be team, the fetch in the configuration file is executed correctly.

4. query = session. createquery ("from student s left Outer Join s. the fetch of the configuration files of student and team classes will be ignored, but the lazy in these classes will be correctly executed.

Related Article

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.