How to Understand the combined use of compass and Hibernate

Source: Internet
Author: User
How to Understand the combination of compass and hibernate. We can quickly add search functions in projects built using hibernate. Here I just want to explain in detail how they work in combination. I understand how the program works. First, we know that hibernate is a well-known ORM framework. Its main function is to bring our development closer to real life. Although many databases are already "Object-type databases", we prefer some relational databases. It seems that we are used to using these databases. As long as there is a relationship with the database, we need to make our program really OOP (Object-Oriented Programming ). Such an intermediate component, object relationship ing (ORM), is indispensable ). This framework is very convenient to help us implement, turning previous operations on relational databases into simple Java operations that we are all familiar, that is, some simple and old object (pojo) operations. A Brief Introduction to hibernate. <1> Hibernate is essentially a middleware that provides data services. Is an object/Relational Database ing tool for Java environments. The Java class is mapped to the table of the database, and the XML technology is used. Javareflection technology. It also provides data query and recovery mechanisms. This greatly reduces the time required to manually process data using SQL and JDBC during development. <2> it is an object link ing framework for source code development. It encapsulates JDBC very lightweight objects. It can be applied to any scenario where JDBC can be used. The previous section briefly introduces hiberante. Compass is a simple encapsulation of Lucene. For example, Hibernate encapsulates JDBC. They are similar. The design principle of compass is designed according to the usage habits of hibernate. Therefore, it is very easy to learn about compass. The combination of compass and hibernate serves as an intermediate bridge. Hibernate is mainly responsible for ing objects to databases. In addition, compass can make full use of existing objects and indirectly contact the database for search. When using compass, we first need to create an index based on the pojo corresponding to each table. At the same time, data synchronization is maintained. We can simply use the following figure: I hope this figure will help you understand the combination of compass and hibernate. I will try my best to answer this question.
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.