Hibernate is a fully automatic durable layer framework (framework);
1. Function: Keep the active object in memory in the relational database forever.
2.o/r/m principle: O-->object object, R---> Relational relational database, M--->mapping map
A solution proposed to address the mismatch between the objects in the application and the tables in the relational database.
3. How to get the session factory in the new version hibernate4 to create a connection object
Configuration cfg = new configuration (). Configure ("Config/hibernate.cfg.xml");
Get the Session factory (Hibernate3), now obsolete
Sessionfactory SF = Cfg.buildsessionfactory ();
Create a service registry, which is now the method of getting the session factory, there are two steps, one: Create a service registry, two: Create a session factory.
Serviceregistry Serviceregistry =
New Serviceregistrybuilder ()
. Applysettings (Cfg.getproperties ())
. Buildserviceregistry ();
Sessionfactory SF = cfg.buildsessionfactory (serviceregistry);
Get session (essentially a connection-connected package)
Session session = Sf.opensession ();
4. What is JDBC?
All in English: Java Data Base Connectivity, which is Java's connection to the database. is a Java API (Java application Programming Interface application programming Interface) for executing SQL statements.
5. What are the problems with using JDBC in hibernate?
First: JDBC cannot cross the database platform (we use dialect dialect to solve this problem in hibernate);
Second: Difficult to maintain, because the SQL statement is written by the programmer himself in DAO, modify the need to find the source code to modify.
6. What is PO?
All in English: persistent object persisted.
7. What is Pojo?
All English: Plain old Java object. Used to represent ordinary Java objects, which do not contain business logic or persistent logic, etc., it can only load data, as a carrier of data storage, but not with the business logic processing power.
What are the advantages of 8.ORM?
One: increase productivity;
Second: maintainability;
Three: Better performance (lazy loading, optimized caching, etc.).
9. What is metadata (meta data)?
Metadata is the data that describes the data, both properties and XML files are a representation of metadata.
What are the 10.ORM frames?
One: JDO; II: MyBatis three: Hibernate.