org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory_stoller' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.MappingException: Association references unmapped class: com.itmg.stroller.dao.model.StrolllerDataModel
Caused by: org.hibernate.MappingException: Association references unmapped class: com.itmg.stroller.dao.model.StrolllerDataModel
at org.hibernate.cfg.HbmBinder.bindCollectionSecondPass(HbmBinder.java:2380)
at org.hibernate.cfg.HbmBinder$CollectionSecondPass.secondPass(HbmBinder.java:2662)
at org.hibernate.cfg.CollectionSecondPass.doSecondPass(CollectionSecondPass.java:43)
at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1130)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1286)<hibernate-mapping package="com.itmg.stroller.dao.model">
<class name="StrollerContentModel" table="t_stroller_content" catalog="gocoohdb_stroller">
<id name="id" type="integer" column="id">
<generator class="native" />
</id>
<many-to-one name="category" class="StrollerCategoryModel" fetch="select">
<column name="category_id" not-null="true" />
</many-to-one>
<property name="title" type="string">
<column name="title" length="200" />
</property>
<property name="publishDatetime" type="date">
<column name="publish_datetime" />
</property>
<property name="description" type="string">
<column name="description" length="200" />
</property>
<property name="content" type="string">
<column name="content" length="200" />
</property>
<set name="pictures" inverse="true" lazy="false">
<key column="content_id" />
<one-to-many class="StrollerPictureModel" />
</set>
<set name="datas" inverse="true">
<key column="content_id"/>
<one-to-many class="StrolllerDataModel"/>
</set>
</class>
</hibernate-mapping><hibernate-mapping package="com.itmg.stroller.dao.model">
<class name="StrollerDataModel" table="t_strollerdata" catalog="gocoohdb_stroller">
<id name="id" type="long">
<column name="id" length="20" />
<generator class="increment"></generator>
</id>
<many-to-one name="content" class="StrollerContentModel" fetch="select">
<column name="content_id" not-null="true"/>
</many-to-one>
<property name="item_name" type="string">
<column name="item_name" length="255"/>
</property>
<property name="item_alias" type="string">
<column name="item_alias" length="255" />
</property>
<property name="item_content" type="string">
<column name="item_content" length="255" />
</property>
</class>
</hibernate-mapping>
看了老半天找不到,大家帮忙看看吧
Caused by: org.hibernate.MappingException: Association references unmapped class: com.itmg.stroller.dao.model.StrolllerDataModel
at org.hibernate.cfg.HbmBinder.bindCollectionSecondPass(HbmBinder.java:2380)
at org.hibernate.cfg.HbmBinder$CollectionSecondPass.secondPass(HbmBinder.java:2662)
at org.hibernate.cfg.CollectionSecondPass.doSecondPass(CollectionSecondPass.java:43)
at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1130)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1286)<hibernate-mapping package="com.itmg.stroller.dao.model">
<class name="StrollerContentModel" table="t_stroller_content" catalog="gocoohdb_stroller">
<id name="id" type="integer" column="id">
<generator class="native" />
</id>
<many-to-one name="category" class="StrollerCategoryModel" fetch="select">
<column name="category_id" not-null="true" />
</many-to-one>
<property name="title" type="string">
<column name="title" length="200" />
</property>
<property name="publishDatetime" type="date">
<column name="publish_datetime" />
</property>
<property name="description" type="string">
<column name="description" length="200" />
</property>
<property name="content" type="string">
<column name="content" length="200" />
</property>
<set name="pictures" inverse="true" lazy="false">
<key column="content_id" />
<one-to-many class="StrollerPictureModel" />
</set>
<set name="datas" inverse="true">
<key column="content_id"/>
<one-to-many class="StrolllerDataModel"/>
</set>
</class>
</hibernate-mapping><hibernate-mapping package="com.itmg.stroller.dao.model">
<class name="StrollerDataModel" table="t_strollerdata" catalog="gocoohdb_stroller">
<id name="id" type="long">
<column name="id" length="20" />
<generator class="increment"></generator>
</id>
<many-to-one name="content" class="StrollerContentModel" fetch="select">
<column name="content_id" not-null="true"/>
</many-to-one>
<property name="item_name" type="string">
<column name="item_name" length="255"/>
</property>
<property name="item_alias" type="string">
<column name="item_alias" length="255" />
</property>
<property name="item_content" type="string">
<column name="item_content" length="255" />
</property>
</class>
</hibernate-mapping>
看了老半天找不到,大家帮忙看看吧
希望也能帮到以后的朋友