hibernate.cfg.xml配置文件中<session-factory>
      <property name="hibernate.hbm2ddl.auto">create</property>
</session-factory><session-factory>
      <property name="hbm2ddl.auto">create</property>
</session-factory>hibernate.hbm2ddl.auto与hbm2ddl.auto这两个属性值有区别吗?

解决方案 »

  1.   

    没有区别,hibernate前缀可以省略
      

  2.   

    都一个意思,是自动创建表,但是用配置创建表是不会显示SQL语句的
      

  3.   

    前面的hibernate.写不写都可以吧,不过我一般不写。
    查询hibernate文档public static final String HBM2DDL_AUTO
       Auto export/update schema using hbm2ddl tool. Valid values are update, create, create-drop and validate.  public static final String HBM2DDL_AUTO ="hibernate.hbm2ddl.auto"