Note that there are some explanatory texts on larger screens.

plurals
  1. POHibernate base entity for Etities those can share similiar properites
    primarykey
    data
    text
    <p>I have few tables in Oracle DB and like to perform reverse engineering. Each DB table column name has unique table-name initials as prefix e.g "ID " as "C_ID", "C_LAST_UPDATED" etc. Secondly, there are few columns those are common in each table e.g. "X_ID" , "X_LAST_UPDATED" where "X" is initials of table. </p> <p>My question is , is it possible to make base entity which holds common properties like id, last updated for aforementioned tables?</p> <p>Thanks in advance</p> <p><strong>EDIT:</strong></p> <p>So far i have tried to create BaseEntity but it do not seems to work while generated Code addresses the problem which i have mentioned earlier i.e. common properties have different column names in each table.</p> <pre><code>@MappedSuperclass public abstract BaseEntity implements java.io.Serializable { @Id @Column(name = "ID", unique = true, nullable = false, precision = 22, scale = 0) private BigDecimal ID ; @Temporal(TemporalType.DATE) @Column(name = "INDATE", nullable = false, length = 7) private Date INDATE; //--- Getters &amp; Setters --- } @Entity @Table(name = "TABLE1", schema = "TEMP_1") public class Entity1 extends BaseEntity { @Id @Column(name = "T1_ID", unique = true, nullable = false, precision = 22, scale = 0) private BigDecimal ID; @Temporal(TemporalType.DATE) @Column(name = "T1_INDATE", nullable = false, length = 7) private Date INDATE; //--- Getters &amp; Setters --- } @Entity @Table(name = "TABLE2", schema = "TEMP_1") public class Entity2 extends BaseEntity { @Id @Column(name = "T2_ID", unique = true, nullable = false, precision = 22, scale = 0) private BigDecimal ID; @Temporal(TemporalType.DATE) @Column(name = "T2_INDATE", nullable = false, length = 7) private Date INDATE; //--- Getters &amp; Setters --- } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload