hibenate.hbm2ddl.auto属性详解
来源:互联网 发布:淘宝站内营销手段 编辑:程序博客网 时间:2024/05/22 05:49
关键字: hibenate hbm2ddl
hibenate.hbm2ddl.auto属性详解
hibernate配置属性中,hibernate.hbm2ddl.auto可以帮助你实现正向工程,即由java代码生成数据库脚本,进而生成具体的表结构.
&在hibernate.cfg.xml中:
Java代码 复制代码
<propertyname="hibernate.hbm2ddl.auto">
</property>
它包含4个属性:
在hibernate中,如果在hibernate.cfg.xml文件中,将hibernate.hbm2ddl.auto设置为update(或者cretae-drop)也可以,如下
<propertyname="hibernate.hbm2ddl.auto">update</property>
则在运行应用程序时(第一次),会自动建立起表的结构(前提是先建立好数据库)。要注意的是,
当部署到服务器后,表结构是不会被马上建立起来的,是要等应用第一次运行起来后才会
如果是spring配置文件中配置则为
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource">
<ref bean="dataSource" />
</property>
<propertyname="hibernateProperties">
<props>
<prop key="hibernate.dialect">
org.hibernate.dialect.Oracle9Dialect
</prop>
<propkey="hibernate.connection.autocommit">true</prop>
<propkey="hibernate.show_sql">true</prop>
<propkey="hibernate.hbm2ddl.auto">update</prop>
</props>
</property>
- hibenate.hbm2ddl.auto属性详解
- hibenate.hbm2ddl.auto属性详解
- hibenate.hbm2ddl.auto属性详解
- hibenate.hbm2ddl.auto属性详解
- hibenate.hbm2ddl.auto属性详解
- hibenate.hbm2ddl.auto属性详解
- hibenate.hbm2ddl.auto属性详解
- hibenate.hbm2ddl.auto属性详解
- hibenate.hbm2ddl.auto属性详解
- hibenate.hbm2ddl.auto属性详解(转载)
- Hibernate下的hibenate.hbm2ddl.auto属性详解
- hbm2ddl.auto 属性
- hbm2ddl.auto属性详解(hibernate自动建表)
- 关于hibernate.hbm2ddl.auto 属性
- hibernate hibernate.hbm2ddl.auto属性
- 【hibernate】配置hbm2ddl.auto属性
- hibernate.hbm2ddl.auto配置详解
- hibernate.hbm2ddl.auto配置详解
- form表单中method的get和pos…
- Spring学习2—Spring容器
- Spring学习8- SSH需要的jar…
- 关于得到子!!childhtml 关于------- magento getChildHtml() 与getChildChildHtml()
- ssh配置文件大全
- hibenate.hbm2ddl.auto属性详解
- spring,hibernate,dao操作数据库模…
- HibernateDaoSupport和 Hiber…
- struts1文件上传
- java代码修改服务器自动重启
- 比较LINQ to Entities的AsQueryable和AsEnumerable方法
- java 文件下载(含POI)
- Struts1 文件上传(含poi)
- 关于改 服务器时间的 测试