云题海 - 专业文章范例文档资料分享平台

当前位置:首页 > JavaEE之SSH2整合技术实现

JavaEE之SSH2整合技术实现

  • 62 次阅读
  • 3 次下载
  • 2026/4/24 12:54:36

http://www.springframework.org/schema/tx/spring-tx-3.0.xsd

http://www.springframework.org/schema/context

http://www.springframework.org/schema/context/spring-context-3.0.xsd http://www.springframework.org/schema/aop

http://www.springframework.org/schema/aop/spring-aop-3.0.xsd\>

class=\ destroy-method=\>

value=\ncoding=UTF-8\/>

--> \>

class=\

cn/edu/bean/Employee.hbm.xml

\>

hibernate.dialect=org.hibernate.dialect.MySQL5Dialect hibernate.hbm2ddl.auto=update hibernate.show_sql=false hibernate.format_sql=false

class=\

步骤6:单元测试

1.右单击src,选择【New】->【Other】 ,操作如图7-13所示,弹出如图7-14所示窗口。

图7-13

图7-14

2.在图7-14所示窗口上单击Next后,弹出图7-15所示窗口。

图7-15

EmployeeServiceTest.java内容如下:

package junit.test;

import java.util.List;

import org.junit.BeforeClass; import org.junit.Test;

import org.springframework.context.ApplicationContext;

import org.springframework.context.support.ClassPathXmlApplicationContext;

import cn.edu.EmployeeService; import cn.edu.bean.Employee; import cn.edu.bean.Gender;

public class EmployeeServiceTest { private static EmployeeService employeeService; @BeforeClass public static void setUpBeforeClass() throws Exception { try { ApplicationContext act = new ClassPathXmlApplicationContext(\

employeeService = (EmployeeService)act.getBean(\ } catch (RuntimeException e) { // TODO Auto-generated catch block e.printStackTrace(); } } @Test public void save(){ employeeService.save(new Employee(\ employeeService.save(new Employee(\ employeeService.save(new Employee(\ employeeService.save(new Employee(\ employeeService.save(new Employee(\ } @Test public void update(){ Employee employee = employeeService.find(\ employee.setGender(Gender.WOMAN); employeeService.update(employee); }

搜索更多关于: JavaEE之SSH2整合技术实现 的文档
  • 收藏
  • 违规举报
  • 版权认领
下载文档10.00 元 加入VIP免费下载
推荐下载
本文作者:...

共分享92篇相关文档

文档简介:

http://www.springframework.org/schema/tx/spring-tx-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd\>

× 游客快捷下载通道(下载后可以自由复制和排版)
单篇付费下载
限时特价:10 元/份 原价:20元
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:fanwen365 QQ:370150219
Copyright © 云题海 All Rights Reserved. 苏ICP备16052595号-3 网站地图 客服QQ:370150219 邮箱:370150219@qq.com