Spring高级程序设计 11 Spring对Hibernate的支持

Spring的ORM模块(结合Hibernate) 概述Spring的ORM模块对Hibernate、iBatis、JDO等ORM框架提供支持。 ORM模块依赖于dom4j-1.6.jar和antlr.jar,需要自己添加两个类库。 本篇文章以结合Hibernate为例。在Spring中Hibernate只是一个Bean 在Spring中,Hibernate的资源要交给Spring来管理。Hibernate和SessionFactory等只是 阅读详情
3Hibernate支持介绍 
Spring的LocalSessionFactoryBean的简化配置:
  1. <context:property-placeholder location="classpath:jdbc.properties" />  
  2. <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"  
  3.     destroy-method="close">  
  4.     <property name="driverClassName" value="${driverClassName}"/>  
  5.     <property name="url" value="${url}"/>  
  6.     <property name="username" value="${username}"/>  
  7.     <property name="password" value="${password}"/>  
  8.     <property name="initialSize" value="${initialSize}"/>  
  9.     <property name="maxActive" value="${maxActive}"/>  
  10.     <property name="maxIdle" value="${maxIdle}"/>  
  11.     <property name="minIdle" value="${minIdle}"/>  
  12.     <property name="maxWait" value="${maxWait}"/>  
  13.     <property name="defaultAutoCommit" value="${defaultAutoCommit}"/>  
  14. </bean>  
  15.   
  16.   
  17. <bean id="sessionFactory"  
  18.     class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">  
  19.     <property name="configLocation" value="classpath:hibernate.cfg.xml"></property>  
  20.     <property name="dataSource" ref="dataSource"></property>      
  21. </bean>  

使用HibernateTemplate或者使用HibernateDaoSupport: 
当然我们使用HibernateDaoSupport的时候,需要sessionFactory的注入,那么就可以先定义一个HibernateDaoSupport的抽象Spring bean,然后让继承HibernateDaoSupport的bean定义一个parent:
  1. ....  
  2. <bean id="hibernateDaoSupport" abstract="true" class="org.springframework.orm.hibernate3.support.HibernateDaoSupport">  
  3.     <property name="sessionFactory" ref="sessionFactory"/>  
  4. </bean>  
  5. <bean id="helloHibernate" class="...." parent="hibernateDaoSupport"/>  
  6. ....  

这样做的好处在于helloHibernate可以省略下面两个东西:
  1. <property name="dataSource" ref="dataSource"></property>  
  2. <property name="hibernateTemplate" ref="hibernateTemplate"></property>  








4在企业级应用程序中使用Hibernate 
1、阻止更新脏数据
 
参照《hibernate 控制并发访问》http://blog.csdn.net/partner4java/article/details/6926546 




2、对象等价性 
当我们在Hibernate中使用持久化集合时,比如set。那么就需要考虑等价性。实现自然等价或者数据库等价。 
主要是根据业务需求重载hashcode和equals 


3、事务支持 
使耽搁DAO方法具有事务性不是一个好的实战,因为他讲在服务层智商定义事务的边界。DAO层应该是一个域对象和一些数据存储方式间的简单转换器。 
配置文件,添加事务支持:
  1. <context:property-placeholder location="classpath:jdbc.properties" />  
  2. <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"  
  3.     destroy-method="close">  
  4.     <property name="driverClassName" value="${driverClassName}"/>  
  5.     <property name="url" value="${url}"/>  
  6.     <property name="username" value="${username}"/>  
  7.     <property name="password" value="${password}"/>  
  8.     <property name="initialSize" value="${initialSize}"/>  
  9.     <property name="maxActive" value="${maxActive}"/>  
  10.     <property name="maxIdle" value="${maxIdle}"/>  
  11.     <property name="minIdle" value="${minIdle}"/>  
  12.     <property name="maxWait" value="${maxWait}"/>  
  13.     <property name="defaultAutoCommit" value="${defaultAutoCommit}"/>  
  14. </bean>  
  15.   
  16.   
  17. <bean id="sessionFactory"  
  18.     class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">  
  19.     <property name="configLocation" value="classpath:hibernate.cfg.xml"></property>  
  20.     <property name="dataSource" ref="dataSource"></property>      
  21. </bean>  
  22.   
  23. <bean id="transactionManager"  
  24.     class="org.springframework.orm.hibernate3.HibernateTransactionManager">  
  25.     <property name="sessionFactory" ref="sessionFactory"></property>      
  26. </bean>  
  27.   
  28. <!-- 事务通知 -->  
  29. <tx:advice id="txAdvice" transaction-manager="transactionManager">  
  30.     <tx:attributes>  
  31.         <tx:method name="new*" propagation="REQUIRED" isolation="DEFAULT" />  
  32.         <tx:method name="save*" propagation="REQUIRED" isolation="DEFAULT" />  
  33.         <tx:method name="update*" propagation="REQUIRED" isolation="DEFAULT" />  
  34.         <tx:method name="delete*" propagation="REQUIRED" isolation="DEFAULT" />  
  35.         <tx:method name="bulk*" propagation="REQUIRED" isolation="DEFAULT" />  
  36.         <tx:method name="load*" propagation="REQUIRED" isolation="DEFAULT" read-only="true"/>  
  37.         <tx:method name="get*" propagation="REQUIRED" isolation="DEFAULT" read-only="true"/>  
  38.         <tx:method name="query*" propagation="REQUIRED" isolation="DEFAULT" read-only="true"/>  
  39.         <tx:method name="find*" propagation="REQUIRED" isolation="DEFAULT" read-only="true"/>  
  40.         <tx:method name="is*" propagation="REQUIRED" isolation="DEFAULT" read-only="true"/>  
  41.           
  42.         <tx:method name="*" propagation="SUPPORTS" isolation="DEFAULT" />  
  43.     </tx:attributes>  
  44. </tx:advice>  
  45. <aop:config>  
  46.         <aop:advisor pointcut="execution(* *..*Service*.*(..))" advice-ref="txAdvice" />  
  47. </aop:config>  



4、延迟加载 
只是在需要的时候抓取数据。 

Spring学习——(六)Spring与Hibernate整合 前面几部分已经基本介绍了Spring的IoC和AOP两大特性,下面就要开始研究和Hibernate等其他框架的整合。 首先来整合Hibernate。在实验中,我采用的是Spring4.2.5和Hibernate4.3.11。在Spring的参考文档中“Object Relational  Mapping (ORM) Data Access”一章讲了和ORM的整合,包括Hibernate、JPA 阅读详情

相关推荐

Spring与hibernate的整合 图解(使用MyEclipse)

Spring通过对Hiberante的支持,使得我们对Hibernate的应用更加的“傻瓜化”,通过直接用MyEclipse我实现简单的整合。现在我们直接上手操作。1、当然是先创建一个数据库表,以供稍后的操作数据。( 在此我使用的MySql5.0)Create table User(    USERNAME VARCHAR(11) PRIMARY KEY NOT NULL,    PASSWORLD VARCHAR(20) NOT NULL)2、在myeclipse 中新建一个web project 2、先

caoshuai 1491

java 11.5_Spring Framework 5.1提供Java 11支持

原标题:Spring Framework 5.1提供Java 11支持SpringOne Platform大会在美国华盛顿特区召开,带来了一大批产品发布和重磅消息。在主题演讲中,Pivotal首席工程师及Spring Framework联合创始人之一Juergen Hoeller谈到了Java 8、新的Java发布规律,以及Spring Framework 5.1对Java 11的支持。 Pivo...

weixin_33309848的博客 229

Spring Boot2 + JDK11使用笔记(不定期更新)

下面描述的问题和解决方法全部基于Gradle构建,Maven用户自行转换 异常处理 Caused by: java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException 启动出现这个错误的原因和JDK9相同,在JDK9开始已经移除了相关代码...

火星人专栏 3849

Spring4 - 11 - spring整合hibernate

··Spring中配置SessionFactory Spring 支持大多数流行的 ORM 框架, 包括 Hibernate JDO, TopLink, Ibatis 和 JPA。 Spring 对这些 ORM 框架的支持是一致的, 因此可以把和 Hibernate 整合技术应用到其他 ORM 框架上. Spring 2.0 同时支持 Hibernate 2.x 和 3.x. 但 Spring 2...

weixin_44130043的博客 208

51单片机通过计时器实现倒计时

51单片机通过计时器操作两位8段阳极数码管,实现倒计时

一份耕耘,一分收获 3万+

Keil5调试遇坑记:手把手解决J-Link驱动与固件版本冲突(附老版本驱动包)

本文详细解析了Keil5与J-Link调试器版本冲突问题,特别是当出现'The connected J-Link is defective'警告时的解决方案。通过对比升级固件与降级驱动的优缺点,提供了详细的J-Link驱动降级操作指南,包括获取老版本驱动、替换步骤及常见问题排查,帮助开发者高效解决这一常见调试障碍。

metaverse5vr的博客 111

Spring Hibernate集成示例教程(Spring 4 + Hibernate 3和Hibernate 4)

Spring is one of the most used Java EE Framework and Hibernate is the most popular ORM framework. That’s why Spring Hibernate combination is used a lot in enterprise applications. Recently I have writ...

从零开始的教程世界 532

用示波器抓取同步Buck自举电容波形:从充电回路到SW节点振铃的完整分析

本文通过实测TI TPS54561和MPS MPQ4572同步Buck芯片,详细解析了自举电容在充电、维持和放电三个工作阶段的波形特征。重点揭示了电感泄放回路与充电回路重叠时,在SW节点引发的振铃现象及其产生机理,并提供了串联阻尼电阻等有效的工程抑制方法。文章结合示波器实测,为硬件工程师提供了从波形观测到问题调试的完整实践指南。

weixin_29276847的博客 376

如何利用 Spring Hibernate 高级特性设计实现一个权限系统

如何利用 Spring Hibernate 高级特性设计实现一个权限系统 ...

犀利豆的博客 378

华为海思IC前端中后端(COT&XPU)岗位笔试机考题

华为海思COT和XPU部门IC前端,IC中端,IC后端岗位笔试真题分享

weixin_37584728的博客 3370

CoaXPress协议入门(1)---- CXP测试套件

CoaXPress (简称CXP)是指一种采用同轴线缆进行互联的相机数据传输标准,主要用于替代之前的Camera Link协议,常见于科学相机、工业相机、医学图像、航空防务等场景。CXP是一个非对称的高速点对点串行传输协议,主要用于传输视频和静态图像,线缆多使用单条或多条同轴电缆。CXP易于集成,可以获得灵活可靠的性能,通过使用标准的同轴线缆,比如RG59 和 RG6规格(推荐使用RG6),并且图像、控制通讯、触发、电源都可以使用同一条线缆。

素手挽剑 9541

Spring框架5.1将提供对Java 11的支持

SpringOne Platform会议最近在华盛顿特区举行,会上发布和宣布了诸多事项。在9月25日上午的主题演讲中,Spring框架的联合创始人兼Pivotal的首席工程师Juergen Hoeller讨论了Java 8、Java新的发布节奏,并宣布Spring框架5.1版本将会支持刚刚发布的Java 11。\\Hoeller首先引用了去年的一项调查:\\\迄今为止,Java 8是Java历史上...

weixin_34387284的博客 79

从零到一:手把手教你用YonBuilder for NCC搭建NC Cloud 2021.11开发环境(含避坑指南)

本文详细指导如何使用YonBuilder for NCC搭建NC Cloud 2021.11开发环境,涵盖硬件要求、软件安装、YonBuilder配置及常见故障排除。特别提供避坑指南,帮助开发者快速上手NCC开发,确保环境配置的原子化分解和开发思维的体系化建立。

weixin_42523326的博客 353

【SpringBoot框架篇】11.Spring Data Jpa实战

文章目录简介JPASpring Data JpaHibernateJpa、Spring Data Jpa、Hibernate三者之间的关系应用实战引入依赖配置文件实体类常用注解@Entity和@Table@Id和@GeneratedValue@Column@Transient继承超类的通用字段属性@MappedSuperclass@Inheritance审计功能启用审计功能在启动类里添加注解在需要使用的类上面添加审计监听器审计功能注解添加审计人 简介 首先了解一下 JPA,Spring Data Jpa,之

皓亮君的博客 4341

CryoEM - 冷冻电镜 基于深度学习的 从头重构(Ab-initio Reconstruction) 开源项目 教程

冷冻电镜(CryoEM) 是一种成像方式,为蛋白质和其他生命基本组成部分的动态,提供独特的观察方式。从数百万噪声和随机取向的二维投影中,以计算效率高的方式,联合估计生物大分子的姿态、三维结构和构象异质性。

AGI 1568

CRC_16---ModBus 计算方法及代码实现

1、 CRC寄存器初始值为 0xFFFF;即16个字节全为1; 2、 CRC-16 / ModBus的多项式0xA001H (1010 0000 0000 0001B) ; ‘H’表示16进制数,‘B’表示二进制数。 计算步骤为: (1).预置 16 位寄存器为十六进制 0xFFFF(即全为 1) ,称此寄存器为 CRC 寄存器; (2).把第一个 8 位数据与 16 位 CRC 寄存器的低位相异或,把结果放于 CRC 寄存器; (3).检测相异或后的CRC寄存器的最低位,若最低位为1,CRC寄存器

1万+

Multi-tenant applications using Spring Boot, JPA, Hibernate and Postgres

Revision #1 on May 9th, 2018: Save operations were failing, added support for Actor instances to be updated via a PATCH endpoint. Updated Transaction Manager section. Revision #2 on Mar 25th, 2019: Ex...

隔壁老瓦的专栏 1147

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

Spring 对hibernate的强大支持

首先需要配置数据源,通常我们有两种方式获得Connection,一是自己编写代码获得连接,二是从JNDI环境中得到DataSource,然后产生 一个Connection。无论怎样,既然是spring下面的对象,就应该注册到配置文件中。假设我们需要一个连接mysql下面一个叫做examer 的数据库,手动方式的配置是:   1.  bean id="dataSource" class="o

PurpleSE的专栏 670

Camera2Demo

在Camera2 的基础上进行封装,使得Camera2一堆初始化逻辑与Activity分离,降低耦合度,完成预览拍照并保存的操作

Devexpress16.2.6破解工具

Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具

Spring Boot 2.1带来了对Java 11的支持以及一系列新功能和改进

从Spring Boot 2.1.0开始已经过去了两个星期。 宣布了 RC1,现在Spring Boot 2.1.0来了 ! 该版本可从repo.spring.io , Maven Central和Bintray获得 。 由于此版本具有许多新功能和改进,因此我们仅涵盖一些最重要的亮点 。 有关完整的升级说明以及值得关注的新功能,请查看发行说明 。 并且也不要忘记阅读Andy Wilkins...

542

华为的C语言编程规范.pdf

华为技术有限公司内部技术规范。本规范制定了编写C语言程序的基本原则、规则和建议。从代码的清晰、简洁、可测试、安全、程序效率、可移植各个方面对C语言编程作出了具体指导。

eclipse集成spring 并支持hibernate

1.在配置了struts和hibernate前提下需要以下jar包 aopalliance-1.0.jar aspectjweaver-1.6.11.jar spring-aop-3.1.1.RELEASE.jar spring-asm-3.1.1.RELEASE.jar spring-beans-3.1.1.RELEASE.jar spring-context-3.1.1.RELEA

lw0532的专栏 699

Spring Hibernate集成示例教程

Spring Hibernate集成示例教程(Spring 4 + Hibernate 3和Hibernate 4) Spring是最常用的Java EE Framework之一,而Hibernate是最流行的ORM框架。这就是Spring Hibernate组合在企业应用程序中大量使用的原因。最近我为Spring Tutorial和Hibernate Tutorial撰写了很多文章...

YunWisdom 325

Webwork2结合Spring, Hibernate

Webwork2结合Spring, Hibernate从User说起,包括创建/修改/删除User,以及对User的列表,先看Webwork2的Action代码 为简单说明问题,不考虑什么Interceptor, Duplicated Submit, Validation,等问题 创建/修改/删除User:UserAction.java相关代码 java

十二棵橡树 1408

Spring AOP事务管理(使用切面把事务管理起来)

在《Spring Transaction 分析事务属性(事务的基本概念、配置)》基础上  1、使用基于注解的AOP事务管理      探索tx:annotation-driven标签:  标签是注解驱动的事务管理支持的核心。  标签的属性:  transaction-manager:指定到现有的PlatformTransactionManager bean的引

java相关技术(partner4java专栏)希望对您的学习有所帮助 6万+
上一篇: Myeclipse Ctrl+Shift+F 快捷键 格式化代码 失效了 不起作用了
下一篇: Spring Transaction 分析事务属性(事务的基本概念、配置)
partner4java
博客等级 码龄17年 481粉丝 183原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
⌂ 换网址