Hibernate urgent left outer connection and urgent inner connection

Source: Internet
Author: User
Tags join
• Urgent LEFT outer connection: left JOIN FETCH keyword indicates an urgent left OUTER join retrieval policy. The –list () method returns a reference to the collection that holds the entity object, and the employee collection associated with each Department object is initialized to hold all the entity objects of the associated employee. – The query results may contain duplicate elements that can be filtered by a HashSet. • LEFT OUTER join: The –left JOIN keyword represents a left outer join query. The collection returned by the –list () method is an object array type – A retrieval policy that determines the Employee collection based on the configuration file.

If you want the list () method to return a collection that contains only Department objects, you can use the SELECT keyword in a hql query statement

• Urgent internal connection: –inner Join the FETCH keyword indicates an urgent inner join, or you can omit a reference to the Department object in the collection returned by the INNER keyword –list () method, and the Employee collection for each Department object is Initialize, hold all associated Employee objects • Internal connection: –inner Join keyword indicates an inner join, or you can omit the INNER keyword –list () method that contains a record of each element in the collection that corresponds to the query result, each element is an object array type-if you want to The returned collection of the list () method contains only the Department object, and you can use the SELECT keyword in a HQL query statement

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.