zoukankan      html  css  js  c++  java
  • atitit.自动生成数据库结构脚本,或者更换数据库,基于hibernate4

    atitit.自动生成数据库结构脚本,或者更换数据库,基于hibernate4

    目前近况::

    更换数据库,但是是使用spring集成的。

    <!-- hibernate配置文件路径 -->

            <property name="mappingDirectoryLocations">

            <!-- classpath -->

                <value>classpath:/hbm</value>

            </property>

    怕是不能使用hbm2ddl cfg....走单独的添加个hb cfg,测试添加给挂走ok..

    作者:: 老哇的爪子 Attilax 艾龙,  EMAIL:1466519819@qq.com

    转载请注明来源: http://blog.csdn.net/attilax

    /wechatAdmin4propt/src/hibernate.cfg4geneDb.xml

    删除多疑的hbm文件,打开使用notepad, 删除多行。。Myeclipse不能删除多行。。

    但是可以增加多行。。选中hbm文件夹。。

    <property name="hibernate.hbm2ddl.auto"   >update</property>

    /wechatAdmin4propt/src/com/attilax/hb/HibernateSessionFactory4geneDb.java

    指向cfg.xml

    测试脚本

     */

    public class geneDB {

    /**

    @author attilax 老哇的爪子

    @since   p2k k_l_v

     

     */

    public static void main(String[] args) {

    Session s=HibernateSessionFactory4geneDb.getSession();

    s.merge(new Object());

    System.out.println("---");

    }

     

    ok

     

  • 相关阅读:
    mysql基础(三)
    mysql基础(二)
    Mysql基础(一)
    Less32-Less-33
    Less-27
    Less-26
    Less-25
    Less-23
    Less18-Less19
    Less13-Less-14
  • 原文地址:https://www.cnblogs.com/attilax/p/5963745.html
Copyright © 2011-2022 走看看