Hibernate is very simple to use, and when we introduce the Hibernate framework into a Java project, we can manipulate the relational database in an object-oriented manner.
Download:
Log on to hibernate website, download hibernate tarball, download. zip package for Windows platform, download. Tar package for Linux platform.
Unzip the package, you can see the following directory structure:
Documentation: the documentation for hibernate under this path, including the reference documentation and API documentation for hibernate.
LIB: The path under which hibernate compiles and runs depends on the third-party class library in which the Require directory is a required jar package.
Project: The source code for hibernate's various related projects is stored under this path.
Since hibernate is still based on JDBC, there must be a JDBC driver package for the corresponding database when using hibernate for persistence in your application.
Hibernate database operations:
There is one important medium in all ORM Frameworks: PO (persistent object) persisted. Hibernate is a low-intrusive design that completely uses common Java Bean objects as persistent objects
Use. The persisted object's class does not need to inherit any of the parent classes, or implement any interfaces.
There are two types of hibernate XML files: Mapping files and configuration files
Map file:
File name: XXXX.hbm.xml (several)
The mapping file completes the persistence class and database table, and the Persistence Class Property (field) corresponds to the Database table column fields.
Configuration file:
file name; Hibernate.cfg.xml (one)
The configuration file completes the connection to which database, the user name and password of the connection database, and the connection pool used when connecting to the database, and the mapping file to use.
Hibernate's profile Default file name is Hibernate.cfg.xml, which is automatically loaded by hibernate when the program calls the Configure () method of the Configuration object.
Hibernate hibernate Download and installation