In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces Hibernate which core interface, the article is very detailed, has a certain reference value, interested friends must read!
Hibernate is an open source object-relational mapping framework that encapsulates JDBC in a lightweight way that allows Java programmers to manipulate databases using object-programming thinking at will. Hibernate can be applied to any use of JDBC occasions, both in Java client programs can also be used in Servlet/JSP Web applications, *** revolutionary significance is that Hibernate can replace CMP in the application of EJB J2EE architecture to complete the task of data persistence.
Hibernate has five core interfaces:Session, SessionFactory, Transaction, Query and Configuration. These 5 Hibernate core interfaces are used in any development. These interfaces allow not only access to persistent objects but also transaction control. Each of the five Hibernate core interfaces is described below.
1. Session interface: The Session interface is responsible for performing CRUD operations on persistent objects (CRUD's task is to complete communication with the database, including many common SQL statements.). It is important to note that the Session object is not thread-safe. Also, Hibernate's session is different from HttpSession in JSP applications. When the term session is used here, it actually refers to the session in Hibernate, and the HttpSesion object will be called the user session later.
SessionFactory interface: The SessionFactory interface is responsible for initializing Hibernate. It acts as a proxy for the data store source and is responsible for creating Session objects. The factory model is used here. It should be noted that SessionFactory is not lightweight, because in general, a project usually only needs a SessionFactory, when you need to operate multiple databases, you can specify a SessionFactory for each database.
Configuration interface: The Configuration interface is responsible for configuring and starting Hibernate, creating SessionFactory objects. During Hibernate startup, an instance of the Configuration class locates the mapping document, reads the configuration, and then creates the SessionFactory object.
Transaction interface: The Transaction interface is responsible for transaction-related operations. It is optional, and developers can design and write their own low-level transaction code.
Query and Criteria interfaces: The Query and Criteria interfaces are responsible for performing various database queries. It can be expressed in either HQL or SQL.
That's all for Hibernate, thanks for reading! Hope to share the content to help everyone, more relevant knowledge, welcome to pay attention to the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.