We have a scenario where active records are stored in one table and over time old records are archived. The table structures for the two tables - active and archive are exactly the same.
E.g DomainObject_Current : ID INT : Autoincrement Key Value INT TimeStamp
DomainObject_Archive ID INT Value INT Timestamp
On a weekly basis we move records over 30 days old to the archive table from the Current table. The ID (Primary Key) is unique across the two tables.
The application should be agnostic of whether the data is coming in from the Current table or the Archive table. What is the best way to map the DomainObject class in this scenario?
You may try to use a view to collect two of the partitioned tables. And DomainObject map to this view.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With