您的位置:首页 > 移动开发

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

2015-04-01 16:00 232 查看
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>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐