Bonjour,
J'aimerais ajouter 3 colonnes dans chacune de mes tables qui correspondent au timestamp (date création, date update, user).
Du coup, j'aimerais que toutes mes classent héritent d'un schéma global qui gère cette fonctionnalité.
J'ai beau lire http://www.hibernate.org/hib_docs/v3...heritance.html, je ne trouve pas de solution simple.
J'aimerais donc simplifier et globaliser l'écriture des mapping suivant :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30 <class name="ObjectExample1" table="TEST1" optimistic-lock="all" dynamic-update="true"> <id name="id" column="id" type="long" unsaved-value="0" > <generator class="increment"/> </id> <property name="value" type="java.lang.Double"> <column name="Value" precision="22" scale="0" /> </property> <property name="lastUpdtDate" type="java.sql.Timestamp"/> <property name="createdDate" type="java.sql.Timestamp"/> <property name="createdDate" type="java.lang.String"/> </class> <class name="ObjectExample2" table="TEST2" optimistic-lock="all" dynamic-update="true"> <id name="id" column="id" type="long" unsaved-value="0" > <generator class="increment"/> </id> <property name="value" type="java.lang.Double"> <column name="Value" precision="22" scale="0" /> </property> <property name="lastUpdtDate" type="java.sql.Timestamp"/> <property name="createdDate" type="java.sql.Timestamp"/> <property name="createdDate" type="java.lang.String"/> </class> etc ...
Comment faire ???
Partager