list下能不能 一对一
GoogdsOrder.hbm.xml
<list access="field" table="drp_listmerchan" name="merch">
<key column="merchId"/>
<list-index column="merchindex"/>
<composite-element class="com.wubobw.drp.vo.ListMerchandise">
<many-to-one unique="true" access="field" name="merchan" not-null="true" class="com.wubobw.drp.vo.ListMerchandise"> </many-to-one>
<property name="merchanNumber" access="field"/>
<property name="totalPrice" access="field"/>
</composite-element>
</list> Merchandise.hbm.xml
<one-to-one name="listMerchandise" access="field" class="com.wubobw.drp.vo.ListMerchandise" property-ref="merchan" />
Tomcat下运行报错
21:25:31,265 ERROR ContextLoader:204 - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'managerorgimpl' defined in file [E:\Tomcat 5.5\webapps\DRP2\WEB-INF\classes\applicationContext-beans.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in file [E:\Tomcat 5.5\webapps\DRP2\WEB-INF\classes\applicationContext-common.xml]: Invocation of init method failed; nested exception is org.hibernate.MappingException: property-ref to unmapped class: com.wubobw.drp.vo.ListMerchandise
Caused by:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in file [E:\Tomcat 5.5\webapps\DRP2\WEB-INF\classes\applicationContext-common.xml]: Invocation of init method failed; nested exception is org.hibernate.MappingException: property-ref to unmapped class: com.wubobw.drp.vo.ListMerchandise
Caused by:
org.hibernate.MappingException: property-ref to unmapped class: com.wubobw.drp.vo.ListMerchandise
有人能帮下么!!
GoogdsOrder.hbm.xml
<list access="field" table="drp_listmerchan" name="merch">
<key column="merchId"/>
<list-index column="merchindex"/>
<composite-element class="com.wubobw.drp.vo.ListMerchandise">
<many-to-one unique="true" access="field" name="merchan" not-null="true" class="com.wubobw.drp.vo.ListMerchandise"> </many-to-one>
<property name="merchanNumber" access="field"/>
<property name="totalPrice" access="field"/>
</composite-element>
</list> Merchandise.hbm.xml
<one-to-one name="listMerchandise" access="field" class="com.wubobw.drp.vo.ListMerchandise" property-ref="merchan" />
Tomcat下运行报错
21:25:31,265 ERROR ContextLoader:204 - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'managerorgimpl' defined in file [E:\Tomcat 5.5\webapps\DRP2\WEB-INF\classes\applicationContext-beans.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in file [E:\Tomcat 5.5\webapps\DRP2\WEB-INF\classes\applicationContext-common.xml]: Invocation of init method failed; nested exception is org.hibernate.MappingException: property-ref to unmapped class: com.wubobw.drp.vo.ListMerchandise
Caused by:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in file [E:\Tomcat 5.5\webapps\DRP2\WEB-INF\classes\applicationContext-common.xml]: Invocation of init method failed; nested exception is org.hibernate.MappingException: property-ref to unmapped class: com.wubobw.drp.vo.ListMerchandise
Caused by:
org.hibernate.MappingException: property-ref to unmapped class: com.wubobw.drp.vo.ListMerchandise
有人能帮下么!!
Error creating bean with name 'managerorgimpl' defined in file
查看managerorgimpl文件。
你去查看下这个类有没有做好对数据库表的映射配置