package test;
import org.hibernate.cfg.Configuration;
import org.hibernate.tool.hbm2ddl.SchemaExport;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.core.io.ClassPathResource;
import org.springframework.orm.hibernate3.LocalSessionFactoryBean;
public class TestSpring {
/**
* @param args
*/
public static void main(String[] args) {
ClassPathResource ac = new ClassPathResource("applicationContext.xml");
XmlBeanFactory xbf = new XmlBeanFactory(ac);
//注意: &sessionFactory ,一定要包含 & ,不加Spring返回的是Hibernate下的SessionFactoryImpl类
LocalSessionFactoryBean lsfb=(LocalSessionFactoryBean) xbf.getBean("&sessionFactory");
Configuration cfg=lsfb.getConfiguration();
SchemaExport export=new SchemaExport(cfg);
export.create(true, false);
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
strtus2+Spring+hibernate整合通过实体类生成数据库表
共76个文件
jar:49个
xml:8个
tld:2个
5星 · 超过95%的资源 需积分: 9 11 下载量 67 浏览量
2015-05-05
10:54:41
上传
评论 1
收藏 13.57MB ZIP 举报
温馨提示
strtus2+Spring+hibernate整合通过实体类生成数据库表
资源推荐
资源详情
资源评论
收起资源包目录
ssh整合通过实体类生成数据库表.zip (76个子文件)
testDemo
.project 2KB
.mystrutsdata 240B
.springBeans 462B
.mymetadata 297B
src
struts.xml 202B
applicationContext.xml 1KB
test
TestSpring.java 888B
entity
Book.hbm.xml 630B
Book.java 485B
WebRoot
WEB-INF
spring-form.tld 69KB
spring.tld 17KB
classes
struts.xml 202B
applicationContext.xml 1KB
test
TestSpring.class 1KB
entity
Book.hbm.xml 630B
Book.class 951B
lib
org.springframework.expression-3.0.1.RELEASE-A.jar 152KB
hibernate-commons-annotations.jar 65KB
javassist-3.9.0.GA.jar 583KB
cglib-2.2.jar 272KB
org.springframework.instrument.tomcat-3.0.1.RELEASE-A.jar 5KB
org.springframework.core-3.0.1.RELEASE-A.jar 347KB
jotm.jar 121KB
dom4j-1.6.1.jar 307KB
org.springframework.aop-3.0.1.RELEASE-A.jar 313KB
org.springframework.web-3.0.1.RELEASE-A.jar 352KB
com.springsource.org.apache.commons.pool-1.5.3.jar 95KB
log4j-1.2.14.jar 359KB
persistence.jar 69KB
com.springsource.org.apache.commons.httpclient-3.1.0.jar 301KB
org.springframework.beans-3.0.1.RELEASE-A.jar 535KB
org.springframework.context-3.0.1.RELEASE-A.jar 642KB
org.springframework.aspects-3.0.1.RELEASE-A.jar 29KB
com.springsource.org.codehaus.jackson.mapper-1.0.0.jar 264KB
org.springframework.web.struts-3.0.1.RELEASE-A.jar 524KB
org.springframework.transaction-3.0.1.RELEASE-A.jar 223KB
slf4j-log4j12-1.5.8.jar 9KB
com.springsource.org.apache.commons.lang-2.4.0.jar 258KB
commons-dbcp.jar 119KB
antlr-2.7.6.jar 433KB
org.springframework.asm-3.0.1.RELEASE-A.jar 52KB
commons-collections-3.1.jar 546KB
org.springframework.web.servlet-3.0.1.RELEASE-A.jar 389KB
xapool.jar 90KB
org.springframework.jdbc-3.0.1.RELEASE-A.jar 369KB
org.springframework.orm-3.0.1.RELEASE-A.jar 324KB
com.springsource.com.mchange.v2.c3p0-0.9.1.2.jar 603KB
org.springframework.instrument-3.0.1.RELEASE-A.jar 2KB
ehcache-1.2.3.jar 203KB
org.springframework.web.portlet-3.0.1.RELEASE-A.jar 169KB
slf4j-api-1.5.8.jar 23KB
hibernate3.jar 2.31MB
ejb3-persistence.jar 49KB
com.springsource.org.aopalliance-1.0.0.jar 5KB
com.springsource.org.apache.commons.fileupload-1.2.0.jar 53KB
com.springsource.net.sf.cglib-2.2.0.jar 319KB
hibernate-annotations.jar 273KB
mysql-connector-java-5.1.18-bin.jar 771KB
hibernate-entitymanager.jar 116KB
jta-1.1.jar 13KB
com.springsource.org.apache.commons.logging-1.1.1.jar 60KB
com.springsource.org.apache.log4j-1.2.15.jar 387KB
hibernate-validator.jar 61KB
com.springsource.org.aspectj.weaver-1.6.8.RELEASE.jar 1.57MB
org.springframework.oxm-3.0.1.RELEASE-A.jar 56KB
web.xml 671B
index.jsp 811B
META-INF
MANIFEST.MF 36B
.myeclipse
.myhibernatedata 557B
.settings
org.eclipse.wst.jsdt.ui.superType.container 49B
org.eclipse.jdt.core.prefs 330B
org.eclipse.wst.jsdt.ui.superType.name 6B
.jsdtscope 500B
org.springframework.ide.eclipse.core.prefs 217B
hibernate.reveng.xml 592B
.classpath 5KB
共 76 条
- 1
资源评论
- k7694442522015-11-19非常感谢发这么好的实例教程
一刹那的永恒
- 粉丝: 99
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功