Note: This series of tutorials. Part of the content from Wang Jian teacher to write SSH integration development tutorialHibernate is an excellent ORM (object Relation mapping-Objects relational Mapping) tool. One of the three best-known frameworks for the struts, spring project, and the Java world.Hibernate is primarily a mapping from tables to Java classes (objects).This section of code takes the code described earlier.Step one: Integrate
code is formatted, comprehensive comments, beautiful and easy to read.11, detailed record system operation log, help the operation and maintenance personnel for system analysis and troubleshooting.12, using Ehcache two cache, Spring MVC static load cache and other mechanisms to improve system performance.13, the data persistence layer is divided into hibernate and MyBatis two big architectures. 2 sets of s
servlet/jsp of the Web The most revolutionary thing to use in the application,Hibernate can be applied in the EJB of the Java the schema replaces CMP to complete the task of data persistence. OrmORM is the meaning of the object-relational mapping, English: Object Relational Mapping abbreviation ORM is a program technology that enables data conversion between systems of different system types in an object-oriented programming language. Well, more conc
Spring+spring mvc+hibernate Environment collocationSpring+spring Mvc+hibernate referred to as "SSH". The spring container is the core of spring, which is responsible for managing Java c
Preface
We've learned how to use spring to integrate with STRUTS2, and this post focuses on how to use spring to integrate Hibernate
Key points for Spring and hibernate consolidation: The Sessionfactory object is given to spring
The Struts framework has the advantages of modular components, flexibility and reusability, and simplifies the development of MVC-based Web applications. Hibernate is an open source object link ing framework. Spring is an open-source project and is currently very active.
This article mainly introduces the advantages and disadvantages of hibernate, struts, an
Naveen Balani continues his Spring series, introducing the knowledge of integrating Hibernate transactions with Spring aspect-oriented programming (AOP). The result is a durable framework that can be relied upon.
In the previous issue of this series, I introduced the Spring Framework's 7 modules, including the
Developing a press release system using maven+hibernate+spring+spring MVCCourse Study Address: http://www.xuetuwuyou.com/course/163The course out of self-study, worry-free network: http://www.xuetuwuyou.comCourse IntroductionFirst, the software used in the course:1. JDK 1.82. Eclipse Neon3. Tomcat 84, Jetty5. MySQL6. Navicat +Second, the technical points involved
Spring and Hibernate integrationSteps1) Introduction of JAR PackageConnection pool/Database driver packageHibernate-related JAR packagesSpring core packages and AOP packagesSpring-ormSpring-tx2) configurationHibernate.cfg.xmlBean.xml3) BuildPackage com.cx.entity;/** * Created by Cxspace on 16-8-11. */public class Dept { private int id; private String name; public int getId () { return ID;
Project directory structure diagram:
Project Structure ChartStep one: Prepare Jar packsThese are the required jar packs for all springmvc+hibernate.Copy all jar packages to the Lib directory of the Web project.Step Two: The configuration file copies and modifies files from the hibernateStart by hitting the ETC folder from the project folder in Hibernate, copying the two files shown in the figure to classpath, as in figure:
Figure 2-1
# # Hypersonicsq
Hibernate
Hibernate3.jar: this is the core jar package of hibernate3.0. It is required. Oh, no choice. For example, the common sessions, queries, and transactions are all in this jar file.
Cglib-2.1.3.jar, cglib library, Hibernate use it to realize dynamic generation of Po bytecode, very core library, necessary.
ASM. Jar ASM bytecode library is required if "cglib" is used.
Asm-attrs.jar ASM bytecode librar
Background:
"Spring (iii): Spring integration Hibernate" previous article has introduced the use of Spring-framework-4.3.8.release and hibernate-release-5.2.9.final Project Integration building process, this article based on the previous article, the integration of STRU
Author: Naveen Balani from: IBM
In the previous phase of this series, I introduced seven modules of the Spring framework, including Spring AOP and IOC containers. Then I used a simple example to demonstrate how the IOC mode (implemented by the Spring IOC container) integrates distributed systems in a loosely coupled manner.
Now, from where I ended last time, I us
Tools: Idea (JDK 1.8) Spring and Hibernate versions are more than 4.0It is recommended that you build your project using MAVEN, which is much easier than importing your jar packages manually. 1. Create a new MAVEN Web project.
First build a MAVEN project, build the project here is not much to say,The correct file structure:-src-main--java (class file)--resources (configuration file)--webapp (web file)-tes
configuration, job-step configuration, and the classic three-step strategy in the Spring batch framework: Data reading, processing, and data writing, and a detailed description of how to file CVS, JSON-formatted files, XML files, The data in the database and the JMS message queue is read, processed, and written, and the operations of the database are described in detail using JDBC, Hibernate, stored proced
used to build it), after learning the general, you can begin to familiar with the spring source.However, spring source is very large, and very versatile is basically just to maintain upward compatibility, so it takes a lot of time to be fully acquainted.That's really the step, basically, any frame that comes up, you can actually take the official documents and start doing the project. "
Today, when I was learning Shiro, I built a springmvc+spring+hibernate integration framework, and then I made an error when I ran the one-many,many-one mapping relationship with lazy loading.
Could not initialize proxy-no the session and then went on the internet to find data, which means that since Hibernate and spring
. AbstractPlatformTransactionManager. doGetTransaction ()AndOrg. springframework. transaction. support. AbstractPlatformTransactionManager. doBegin (Object, TransactionDefinition)
That is to say, these key tasks must be implemented by the specific transaction manager. For the hibernate Transaction Manager, the method to obtain the transaction object is as follows:
The procedure for starting a transaction is as follows:
The above is the code about th
This configuration is the spring, SPRINGMVC, hibernate three modules are configured separately, cross-reference! Hibernate connection configuration using the. properties fileWeb. XML configuration Spring.xml Springmvc.xml Spring_hibernate.xml Congfig.properties (Hibernate connection Configuration)#MySQL hibernate.
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.