Hibernate Summary 1. hibernate SummaryUse List, Map, and Class Object to customize the return type in hibernate.
When hibernate is used for query, the most commonly used query is by building hql. In the Query Process, in addition to frequently used object query methods, you can also query an attribute or a group of clu
Hibernate Association ing and hibernate Association ing
Relationship between entitiesAssociation, aggregation, dependency, combination, inheritance
Link Type:One-to-multipleMany-to-oneOne-to-oneMany-to-many
Student table and grade Table:
1 -- student table 2 create table student (3 stuno number (4) primary key, 4 name varchar2 (20) not null, 5 gradeid number (4) 6 7) 8 -- grade table 9 create table grade
1. Download and unzip Hibernate-distribution-3.3.2.ga.zip and Slf4j-1.5.8.zip2. Locate in the Hibernate-distribution-3.3.2.ga folder:Hibernate3.jar3. Locate the necessary jar packages in the Hibernate-distribution-3.3.2.ga/lib/required folder for hibernate to run:Antlr-2.7.6.jarCommons-collections-3.1.jarDom4j-1.6.1.ja
In the past two days, spring + JPA (hibernate implementation) has been compiled and a piece of hibernate connection parameter configuration has been copied from the Internet.
Properties
>
Property
Name
= "Hibernate. show_ SQL"
Value
= "True"
/>
Property
Name
= "Hibernate. hbm2dd
Hibernate batch processing:
Hibernate batch processing actually from the performance considerations, it is very undesirable, wasting a lot of memory. From its mechanism, hibernate first detects the qualifying data, puts it in memory, and then operates. Actual use down performance is very unsatisfactory, in the author's actual
The use of the following third opti
The Hibernate database connection information is loaded from the configuration file.
The configuration file of hibernate can be in either XML or properties.
1) hibernate. cfg. xml
In addition to the basic hibernate configuration information, you can also specify a persistence class ing file in the XML configuration fil
Detailed explanation of Hibernate Cache Technology and hibernate CacheReprinted with the source: http://www.cnblogs.com/xiaoming0601/p/5882980.html一: it does not mean the first-level cache of the computer's memory or CPU; cache is a strategy to reduce the frequency of application access to physical data sources and improve the running performance of applications. Ii. Why cache is used: 1. The efficiency of
Hibernate Level 1 cache and level 2 cache, hibernate Level 1 Cache
The cache is between applications and physical data sources. It is used to reduce the frequency of applications accessing physical data sources and improve the running performance of applications. Data in the cache is the replication of data in the physical data source. during runtime, the application reads and writes data from the cache. Da
In the previous Article Hibernate Learning series-----(1) Development environment building, roughly summed up hibernate development environment of the building steps, today, we continue to learn about hibernate knowledge, first talk about the main content of this article:
Configuration class
Sessionfactory interface
Session interface
Transact
Hibernate is an open source object-relational mapping framework that provides JDBC with a very lightweight object encapsulation that maps Pojo to database tables, and is a fully automated ORM framework hibernate can automatically generate SQL statements, automatically execute, So that Java programmers can use object programming thinking to manipulate the database at will.
How to generate Hibernate entity class from database backwards???1. First, use your own database Manager (data Management) in eclipse to connect to your database:Then select the database, use Oracle here, and then give a name, such as MyOracle.Click the button to create a new database-driven configuration.Select the database version, which is the Oracle 10g version, and you can name it for that configuration.Then select the appropriate database versio
Getting started with Hibernate framework Association ing and hibernate framework ing
Ing is to map the ing relationship to the database, which is one or more references in the object model.1. Configure one-way multi-to-one Association
Define a Dept attribute in the Emp class, but do not need to define the set attribute used to store the Emp object in the Dept class.
01. Dept. java
Package cn. zhang. entity;
Common APIs in Hibernate and common APIs in Hibernate1. Configure 1.1 load the core Configuration file,
When loading hibernate. properties: Configuration configuration = new Configuration ();
When hibernate. cfg. xml is loaded: Configuration configuration = new Configuration (). configure ();1.2 load the ing file (however, generally, the ing files are configured
Hibernate multi-to-Multi-two-way Association configuration, hibernate multi-to-one Association
There are two configuration methods for Hibernate's Bidirectional Multi-to-Multi-Association: Let's take a look at how the two solutions are configured.
1. Create a set of classes for Association
1. First, we need to add a set of two entity classes (employee
1.1 employee entity
Package cn. manytow.one; import jav
Recently, the system encountered such a problem. I Googled it online and the result was a data problem.Console error printing:Severe: servlet. Service () for servlet default threw exceptionOrg. hibernate. objectnotfoundexception: no row with the given identifier exists: [COM. ISS. Fit. Po. system. sysdepartment #361]At org. hibernate. impl. sessionfactoryimpl $1. handleentitynotfound (sessionfactoryimpl. Ja
Label:Configuration steps for Hibernate environments:
Add the jar packages required for hibernate, adding these jars to project,
the establishment of Hibernate.cfg.xml. Hibernate's hibernate.cfg.xml configuration file defaults to the PROJECT/SRC directory,
The contents of the Hibernate.cfg.xml are as follows (this is, of course, copied from Hibernate's Reference document and not modified):
What is Hibernate?Hibernate is a ormapping frameHibernate is an operational framework for manipulating databasesWhy to use HIBERNATEJDBC's disadvantage1, the code is quite cumbersome2, moving from one database to another database, you have to change a lot of content, poor3. See:When making a request, it is possible to extract the data directly from memory, a process called a data cacheAlthough JDBC provides
Hibernate framework Study Notes 6: transactions, hibernate Study Notes
MySQL transactions and JDBC transaction operations:
For details, see this article: More detailed
Http://www.cnblogs.com/xuyiqing/p/8430214.html
How to configure the isolation level in hibernate:
In the core configuration file:
Here it is binary, which is converted to decimal 1, 2, 4, 8
Man
In hibernate. cfg. xml, the hibernate. hbm2ddl. auto Configuration node is as follows:
Hibernate Reference Documentation 3.3.1 is explained as follows:Automatically validate or export schema DDL to the database when the SessionFactory is created.With create-drop, the database schema will be dropped when the SessionFactory is closed explicitly.Eg. validate | updat
(The Hibernate learning Note series comes from "Crazy Java" video learning)Hibernate overview免费开源Java包,可以使程序和数据库的交互变得容易,并更加符合面向对象的设计。持久化:将数据保存到数据库中Hibernate Persistence class Steps
Environment construction
Import the jar package, in the \lib\required folder in the Hibernate package
Importing the J
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.