日期:2014-05-17  浏览次数:20636 次

Caused by: org.hibernate.MappingException: Association references unmapped class: com.elone.pm.product.dao.TAttribute
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [com/elone/pm/applicationContext.xml]: 

Invocation of init method failed; nested exception is org.hibernate.MappingException: Association references unmapped class: com.elone.pm.product.dao.TAttribute
Caused by: org.hibernate.MappingException: Association references unmapped class: com.elone.pm.product.dao.TAttribute
at org.hibernate.cfg.HbmBinder.bindCollectionSecondPass(HbmBinder.java:2370)
at org.hibernate.cfg.HbmBinder$CollectionSecondPass.secondPass(HbmBinder.java:2652)
at org.hibernate.cfg.CollectionSecondPass.doSecondPass(CollectionSecondPass.java:43)
at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1127)

=============================================
applicationContext.xml

<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="configLocation">
<value>classpath:/com/elone/pm/hibernate.cfg.xml</value>
</property>
</bean>
<bean id="attributeDAO" class="com.elone.pm.product.dao.hibernate.TAttributeDAOImpl">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
=================================
hibernate.cfg.xml
<mapping
resource="com/elone/pm/product/pojo/TAttribute.hbm.xml" />
==========================================================
TAttribute.hbm.xml

<hibernate-mapping>
  <class name="com.elone.pm.product.pojo.TAttribute" table="T_ATTRIBUTE" schema="ELPLAT">
  <id name="typeid" type="java.lang.String">
  <column name="TYPEID" length="32" />
  <generator class="uuid.hex" />
  </id>
  <many-to-one name="protype" lazy="false" class="com.elone.pm.product.pojo.TProtype" fetch="select">
  <column name="PROCLASSID" length="32" />
  </many-to-one>
  <many-to-one name="parent" lazy="false" class="com.elone.pm.product.pojo.TAttribute" fetch="select">
  <column name="PARENTID" length="32" />
  </many-to-one> 
  <property name="attname" type="java.lang.String">
  <column name="ATTNAME" length="50" />
  </property>
  <property name="attorder" type="java.lang.String">
  <column name="ATTORDER" length="50" />
  </property>
  <property name="attstyle" type="java.lang.String">
  <column name="ATTSTYLE" length="