2

I am using hbm files (to keep pure pojo classes with no annotation) and I'd like to use a super class with technical information (id, creation/modificaiton date and user) as @mappedclass annotation.

<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>

How to declare in child the abstract inheritance ? Is it possible ??

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

Thanks for your help !

Rod
  • 21
  • 1

1 Answers1

0

Maybe this is what you are looking for:

<class name="FilleEntity" table="MA_TABLE">
    <meta attribute="extends">AbstractEntity</meta>
Henry
  • 2,650
  • 2
  • 19
  • 23