In the previous blog, the caching mechanism of hibernate was introduced. Reasonable configuration of the cache, can greatly optimize the performance of hibernate. This blog introduces another way of tuning: crawl strategy.first, what is a crawl strategyCrawl strategy (fetching strategy): How hibernate gets the policy of the associated object when the application
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
Hibernate cache mechanism and hibernate Cache Mechanism
I. why (why use Hibernate cache ?)
Hibernate is a persistent layer framework that frequently accesses physical databases.
To reduce the frequency of applications accessing physical data sources and improve the running performance of applications.
Data in the cache
Catalog:(Follow-up update ...) )
Getting Started with Hibernate 01-Framework technology (Introduction to the development of the Hibernate framework)
Hibernate Introductory 02-hibernate Introduction and its environment construction
Getting Started with Hibernate
Hibernate cache and hibernate Cache MechanismI. Hibernate cache Overview
Hibernate provides two levels of cache: first-level cache and second-level cache.
1. The first-level cache is a Session-level cache that belongs to the scope of transactions. The first-level cache is managed by
The main purpose is to familiarize yourself with the differences between hibernate2 and hibernate3 and provide a little extra space for the current project.
1. Replace hibernate2.jar with hibernate3.jar (hibernate-3.0.5)The hibernate-tools.jar is also replaced with a new one (found from the hibernate-tools-3.0.0.alpha4a)
2. replace net. SF.
Hibernate Hibernate Environment ConfigurationFirst, hibernate environment to build the steps1. Add the jar for Hibernate SQL ServerAntlr-2.7.7.jarDom4j-1.6.1.jarHibernate-commons-annotations-4.0.5.final.jarHibernate-core-4.3.11.final.jarHibernate-jpa-2.1-api-1.0.0.final.jarJandex-1.1.0.final.jarJavassist-3.18.1-ga.jar
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
Hibernate persistent operation in simulated hibernatehave used Hibernate, we all know, because of its object-oriented design, it is very convenient to use, and has a good cross-database, then the bottom of hibernate is how to achieve it? In fact, it is the transformation of the object model into a relational model, and ultimately the SQL statement to execute. hav
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
Generally, we will create a hibernate. cfg. xml file. This is undoubtedly good. Although the method described below is not good, it is undoubtedly a method;
We can directlyCodeSet a series of parameters;
Main functions:
(1) configuration Config = new configuration (); // Create a configuration
(2) config.Setproperties(Properties P );// Import the configuration
(3) config.Addclass(Class C );// Create a ing (only the class object needs to be s
Applications can access the database through Hibernate's API, and the interfaces in the Hibernate API can be categorized into the following categories:Provides access to database operations (save, UPDATE, delete, query) interfaces, which include session, Transaction, and query interfacesInterface for configuring Hibernate: ConfigurationCallback interface, which allows the application to accept events occurr
Core interfaces of Hibernate and core interfaces of hibernate
1. Persistence and ORM
Persistence refers to the storage of data (Objects in memory) to persistent storage devices (such as hard disks). It is mainly used to store data in memory to relational databases, in a three-tier structure, the persistence layer focuses on implementing the logic layer of the system and associates data users with data
First, install Hibernate tools Plugin1, online installationVia the eclipse's Help->install New software online installation plugin, the plug-in connection is:
Eclipse Helios (3.6) edition
Add the following address: http://download.jboss.org/jbosstools/updates/stable/helios/Optional installation: Hibernate tools under the all Jboss tools node
Eclipse Indigo (3.7) edition
Add the f
This article has a lot of slots, in the hibernate4.x above with hibernate3.x writing to write. And there will be a lot of warnings in the program to eclipse, but that's a certain level of getting started with hibernate. After all, many of the books that introduce hibernate now are written in the hibernate3.x notation. The last time that "hibernate" is the simples
SSH framework-transition of three statuses of hibernate, ssh-hibernate1. amazing things
When I used the findAll () method to investigate a List object, I performed some operations on the list object without calling the update or saveOrUpdate method, the changed data is magically saved to the database.
Finally, the simple and crude solution is to copy the List found from the data, operate it, and return the result. The data is normal, and the database
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.