2012-04-10 76 views
2

我使用hbm文件(保留纯粹的pojo类没有注释),我想用技术信息(id,创建/修改日期和用户)的超类作为@mappedclass注释。将hbm作为@mappedclass注释映射到继承

<hibernate-mapping> 
<class name="AbstractEntity" abstract="true"> 
    <id name="entityId"></id> 
    <!-- Id overridé dans les classes filles --> 
    <property name="userCreation" type="string"> 
     <column name="USR_LOG_I" length="20" not-null="true" /> 
    </property> 
    <property name="dateCreation" type="timestamp"> 
     <column name="DTE_LOG_I" length="26" not-null="true" /> 
    </property> 
    <property name="userModification" type="string"> 
     <column name="USR_LOG_U" length="20" not-null="true" /> 
    </property> 
    <property name="dateModification" type="timestamp"> 
     <column name="DTE_LOG_U" length="26" not-null="true" /> 
    </property> 
    <property name="audit" type="string"> 
     <column name="AUDIT" length="10" /> 
    </property> 
</class> 

如何在子中声明抽象继承?可能吗 ??

hibernate-mapping> 
<class name="FilleEntity" table="MA_TABLE">....... 

感谢您的帮助!

回答

0

也许这是你在找什么:

<class name="FilleEntity" table="MA_TABLE"> 
    <meta attribute="extends">AbstractEntity</meta>