<hibernate-mapping>
<class name="testEntity.MappingMyself" table="MappingMyself">
<id name="id" type="java.lang.String">
<column name="MappingMyselfId" length="32" />
<generator class="uuid.hex" />
</id>
<property name="name" type="java.lang.String" /> <!--
<many-to-one
name="mappingMyself"
class="testEntity.MappingMyself"
cascade="none"
column="MappingMyselfId"
not-null="false"
/>-->
</class>
</hibernate-mapping>
实现类似于这样的 自我映射 如何实现呀就是 自己有自己的映射
你要是像不配关系就生成实体表的话只要在配置文件上写好就行了
<column name="MappingMyselfId" length="32">
<comment>...</comment>
</column>
</many-to-one>
这写你自已的路径
<comment>特训科目表</comment>
<id name="subjectId" type="java.lang.String">
<column name="SUBJECT_ID" length="32" />
<generator class="uuid" />
</id>
<many-to-one name="TSubject" class="com.tianque.bo.TSubject" fetch="select">
<column name="PARENT_ID" length="32">
<comment>上级科目id</comment>
</column>
</many-to-one>
</class>这是我的你可以看一下