1. Introduce hibernate
Important Concept: Model Mismatch
2. install and configure
Currently the latest version of hibernate: http://sourceforge.net/projects/hibernate/files/hibernate3/3.6.6.Final/
Other versions download: http://sourceforge.net/projects/hibernate/files/hibernate3/
The downloaded JAR file in the lib directory is the jar package required for hibernate running, so it is indispensable (of course, depending on the situation, some specific requirements will use some jar packages)
3. Basic Concepts
① Development process: there are three main processes. The first method is recommended.
② Domain object restrictions:
You must have a default construction method without parameters (used for later new objects)
Identifier ID, which is optional and generally has
The class cannot be final, and the final class cannot be inherited. If it is declared as final, it will affect the lazy loading.
③ Compile classname. HBM. XML to define an ORM (object relation mapping) for a class)
④ Write JavaCode: Note:ProgramRead the configuration file only once!
So it can be put in the static of a class.
Detailed examples will be explained later.