本文最先发布在个人博客,[url=http://www.lovestblog.cn]http://www.lovestblog.cn[/url],主要用图来说明问题哈
[img]http://dl.iteye.com/upload/attachment/132083/6a7f0440-9c63-3ee3-be27-5dc48d5ff364.jpg[img]
[img]http://dl.iteye.com/upload/attachment/132085/ea6850b7-8743-3eef-aaf3-2f70e284a4a0.jpg[/img]
[img]http://dl.iteye.com/upload/attachment/132086/ece18849-56c2-32b9-b7cc-559846f8d797.jpg[/img]
[img]http://dl.iteye.com/upload/attachment/132089/45dcad57-fbce-3636-947d-f78f817df3e5.jpg[/img]
[img]http://dl.iteye.com/upload/attachment/132090/be492bc3-f6a6-3438-9f8f-e01764731030.jpg[/img]
[img]http://dl.iteye.com/upload/attachment/166583/1971f2b4-ea96-3480-ab02-0fcd3f0758c6.jpg[/img]
[img]http://dl.iteye.com/upload/attachment/166585/684bc518-6616-3aef-a0a1-6a3ae1b95a58.jpg[/img]
[img]http://dl.iteye.com/upload/attachment/132097/2e9539f8-6f2b-32ea-81b2-a8e6696eb949.jpg[/img]
[img]http://dl.iteye.com/upload/attachment/132099/0a5eb8f4-0e6e-33ba-95cb-6540ba23a404.jpg[/img]
[img]http://dl.iteye.com/upload/attachment/132102/a8c91dc5-58f4-3d72-86a1-feee66475c29.jpg[/img]
[img]http://dl.iteye.com/upload/attachment/132100/37c28e9a-4d60-3f03-8291-4304c98f786a.jpg[/img]
[img]http://dl.iteye.com/upload/attachment/132105/bec9b6eb-a48e-36d4-a291-8914b79f9601.jpg[/img]
[img]http://dl.iteye.com/upload/attachment/166587/610e0d67-4a78-3104-9989-c2a1a4573dbb.jpg[/img]
在web-inf文件夹下删除图中选中的三个jar包,因为Spring和Hibernate的部分jar包有冲突。
好了,再附上相关的测试代码哈:
[img]http://dl.iteye.com/upload/attachment/132083/6a7f0440-9c63-3ee3-be27-5dc48d5ff364.jpg[img]
[img]http://dl.iteye.com/upload/attachment/132085/ea6850b7-8743-3eef-aaf3-2f70e284a4a0.jpg[/img]
[img]http://dl.iteye.com/upload/attachment/132086/ece18849-56c2-32b9-b7cc-559846f8d797.jpg[/img]
[img]http://dl.iteye.com/upload/attachment/132089/45dcad57-fbce-3636-947d-f78f817df3e5.jpg[/img]
[img]http://dl.iteye.com/upload/attachment/132090/be492bc3-f6a6-3438-9f8f-e01764731030.jpg[/img]
[img]http://dl.iteye.com/upload/attachment/166583/1971f2b4-ea96-3480-ab02-0fcd3f0758c6.jpg[/img]
[img]http://dl.iteye.com/upload/attachment/166585/684bc518-6616-3aef-a0a1-6a3ae1b95a58.jpg[/img]
[img]http://dl.iteye.com/upload/attachment/132097/2e9539f8-6f2b-32ea-81b2-a8e6696eb949.jpg[/img]
[img]http://dl.iteye.com/upload/attachment/132099/0a5eb8f4-0e6e-33ba-95cb-6540ba23a404.jpg[/img]
[img]http://dl.iteye.com/upload/attachment/132102/a8c91dc5-58f4-3d72-86a1-feee66475c29.jpg[/img]
[img]http://dl.iteye.com/upload/attachment/132100/37c28e9a-4d60-3f03-8291-4304c98f786a.jpg[/img]
[img]http://dl.iteye.com/upload/attachment/132105/bec9b6eb-a48e-36d4-a291-8914b79f9601.jpg[/img]
[img]http://dl.iteye.com/upload/attachment/166587/610e0d67-4a78-3104-9989-c2a1a4573dbb.jpg[/img]
在web-inf文件夹下删除图中选中的三个jar包,因为Spring和Hibernate的部分jar包有冲突。
好了,再附上相关的测试代码哈:
package org.rjb.dao;
import junit.framework.Assert;
import junit.framework.TestCase;
import org.rjb.idao.IRolesDAO;
import org.rjb.pojo.Roles;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
public class RolesDAOTest extends TestCase {
private IRolesDAO rd;
public void setUp(){
System.out.println("Begin Test");
ApplicationContext ac=new ClassPathXmlApplicationContext("applicationContext.xml");
rd=(IRolesDAO)ac.getBean("RolesDAO");
}
public void tearDown(){
System.out.println("End Test");
}
public void testSave(){
Roles r=new Roles();
r.setRoleName("ttt");
Roles rs=rd.save(r);
Assert.assertTrue(rs.getSequenceId()>0);
}
public void testDelete(){
}
public void testFindAll(){
}
public void testMerge(){
}
}