'Is it possible to reuse the same entity class for two tables (one table at a time)?
Is it possible to reuse one entity class for inserting data into two tables which are identical?
I have master tables (one parent and 9 child tables) and staging tables (one parent and 9 child tables). Only table names are different and rest all same.
My use case is if there is no workflow process, data gets saved to master tables (10). If there is workflow involved, data has to be saved to staging tables and after workflow approval, it has to be copied to master tables.
Please let me know the right approach to design the entity classes and reuse the entity classes.
Solution 1:[1]
I got directions from the answer in below link. I can apply polymorphism to use respective implementation class and @Inheritance annotation instead of @MappedSuperclass.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Rambabu Kokkiligadda |
