当前位置: 代码迷 >> Web开发 >> hibernate有关问题。
  详细解决方案

hibernate有关问题。

热度:357   发布时间:2012-02-21 16:26:23.0
hibernate问题。。。
用hibernate生成数据类和映射文件,但是为什么在hibernate.cfg.xml里面没有映射文件地址直接生成,要怎么做

------解决方案--------------------
XML code
<hibernate-configuration>
    <session-factory>
        <property name="hibernate.connection.url">jdbc:mysql://localhost/hibernate_basemapping</property>
        <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
        <property name="hibernate.connection.username">root</property>
        <property name="hibernate.connection.password">long</property>
        <property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
        <property name="hibernate.show_sql">true</property>
        
        <mapping resource="com/bjsxt/hibernate/User.hbm.xml"/>
    </session-factory>
</hibernate-configuration> 
  相关解决方案