这是的配置文件
<hibernate-mapping>
<class name="com.bookstore.object.Product" table="product">
<cache usage="nonstrict-read-write"/>
<id name="productId" column="productId" type="string" unsaved-value="null">
<generator class="assigned"/>
</id>
<property name="productName" column="productName" type="string"/>
<property name="description" column="description" type="string"/>
<property name="categoryId" column="category" type="string"/>
</class>
</hibernate-mapping>
<hibernate-mapping>
<class name="com.bookstore.object.Product" table="product">
<cache usage="nonstrict-read-write"/>
<id name="productId" column="productId" type="string" unsaved-value="null">
<generator class="assigned"/>
</id>
<property name="productName" column="productName" type="string"/>
<property name="description" column="description" type="string"/>
<property name="categoryId" column="category" type="string"/>
</class>
</hibernate-mapping>
<property name="connection.username">root</property>
<property name="connection.url">jdbc:mysql://localhost:3306/ebookstore</property>
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="connection.password">1234</property>
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<mapping resource="CategoryImp.hbm.xml"/>
<mapping resource="ItemImp.hbm.xml"/>
<mapping resource="OrderImp.hbm.xml"/>
<mapping resource="ProductImp.hbm.xml"/>
<mapping resource="AccountImp.hbm.xml"/>
<mapping resource="OrderItemImp.hbm.xml"/> </session-factory></hibernate-configuration>
<mapping resource="OrderItemImp.hbm.xml"/>
这里改成绝对路径试试
你下个sp4
就好了