struts+hibernate 搭的框架,what‘s wrong?


org.hibernate.MappingException: Unknown entity: dxm.com.vo.User  ??


ok 在hibernate配置文件中没有配置。对象mapping。

原代码如下:

 <hibernate-configuration>
  <session-factory>

  <property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
  <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
  <property name="hibernate.connection.url">jdbc:mysql:///test</property>
  <property name="hibernate.connection.user">root</property>
  <property name="hibernate.connection.password">123###</property>
 
  </session-factory>
 </hibernate-configuration>


修改之后 

 <hibernate-configuration>
   <session-factory>

   <property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
   <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
   <property name="hibernate.connection.url">jdbc:mysql:///test</property>
   <property name="hibernate.connection.user">root</property>
   <property name="hibernate.connection.password">123###</property>
    

        <mapping resource="user.xml" />
   </session-factory>
  </hibernate-configuration>




本文转载:CSDN博客