Java framework --- hibernate connection pool, java --- hibernate
Hibernate supports third-party connection pools. the officially recommended connection pools are C3P0, Proxool, and DBCP. Note the following three points when configuring the connection pool:1. Apche's DBCP is supported in Hibernate2, but it is no longer recommended in Hibernate3. The official expla
describe the database to accomplish this task, through the degree Niang found hibernate.So here I will record the process of learning hibernate framework, so as not to forget after the use of ...Today I will complete the configuration of the environment and build a simple hibernate project, using the development tools for MYECLIPSE10, the database for MySQL.Before we do the necessary preparation: Java JDK
/**
Author: willpower
Source: rifoo Technology (http://www.rifoo.com)
Time: 2006-05
Remarks: Reprinted please keep the above statement
**/
Today we will end the first chapter.
Let's take a look at the content generated by the database.
When creating a hibernate application, if a database exists, you do not need to manage the schema. If no database exists and it is a brand new application, you need to create a database schema (The schema here refers t
June 7. Clear. " Red purple has become dust, cuckoo sound in the Shiring." The road of Mulberry hemp is endless. The beginning is known as the Taiping people.”Hibernate and Spring eclectic meet, not only the beans and beans between the lightning-like collision, but also between XML and XML in the ping water gathering. Two singular architectures, hand-lakes, not only shape the thrill of dependency injection. Also let the java EE leap Red half of the e
Label:The purpose of this blog: ① summary of their own learning process, equivalent to study notes ② to share their own experience to everyone, learn from each other, communication, not commercial content inevitably appear problems, welcome to correct, exchange, discussion, you can leave a message, can also be contacted by the following ways. I Internet technology enthusiasts, Internet technology enthusiasts Weibo: Ivan is in 0221 qq:951226918 ---------------------------------------------------
Reprint please specify the Source: http://blog.csdn.net/fxdaniel/article/details/42420779
Next article: Hibernate study notes (i)--build Hibernate development environment
First look at the hibernate development of a simple process:
(1) Prepare the development environment and create hibernate projects.
(2) Create the d
If an object with the same OID (primary key) already exists in the session of hibernate save, an exception occurs. The details are as follows:
Exception in thread "Main" org. hibernate. nonuniqueobjectexception: a different object with the same Identifier value was already associated with the session: [COM. unmi. loandetail #1]At org. hibernate. event. Def. abstr
Preparation
You need to download the latest release versions of these projects as follows:
1. Hibernate Core, the version used here is 3.5.0-final
2. Hibernate Shards. The version 3.0.0-Beta2 is used here.
3. MySql java connector, the version used here is 5.1.12
4. slf4j, the version used here is 1.5.11
5. Install and start the mysql service, create the database hbshards in mysql, and create the test contac
Hibernate notes ----------- core interfaces of Hibernate
There are five core interfaces:
1) Configuration interface: Configure Hibernate, start Hibernate at the root, and create the SessionFactory object.
Hibernate applications use Configuration to obtain the object-the met
Hibernate set type ing and hibernate set ing
Unordered Set elements cannot be repeated.
List ordered elements can be repeated.
Unordered Bag elements can be repeated.
Map key-value pairs
Student:
Package model;Import java. util. Set;Public class Student {Private long id;Private String name;Private Set Public long getId (){Return id;}Public void setId (long id ){This. id = id;}Public String getName (){Retur
Eclipse generates Hibernate entity classes backwards from the databaseDo the project must first make the database table design, and then based on the database design to establish the entity class (VO), which is a matter of course, but in the company to do projects, let me realize, did not say that both after the database design and then "own" to establish a change VO. This means that when the project is designed, either the entity class is built accor
Level 1 cache, level 2 cache, and lazy loading (transfer) in Hibernate, and level 1 cache in hibernate1. Why cache?
Hibernate uses cache to reduce the number of accesses to the database, thus improving the execution efficiency of hibernate. There are two types of cache in hibernate: level-1 cache and level-2 cache.2. L
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
First, create a configuration objectThe only function of a configuration instance is to create a sessionfactory instance; If the mapping definition file is in the class load path, the AddResource () method can be used to add the mapping definition file3 Ways to configure Hibernate:using Hibernate.properties as a configuration file (\project\etc\hibernate.properties)Configuration cfg = new configuration ();//Call the AddResource method multiple times, add the mapping file Cfg.addresource ("Item.h
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.