Posted: 7 Jan 2019 6:25 EST Last activity: 21 Jan 2019 17:38 EST
Two tables merged into single table
Hi, Currently we have two tables for two different customers (say Normal and Platinum) and we mapped two different class to two tables like Org-App-Data-NCustomer, Org-App-Data-PCustomer.
Now from the database level the two tables are merged into single table Customer and the existing two tables will be deleted. My question is
1)Should I create a new class Org-App-Data-Customer and refactor and delete the existing classses and change the application code , which is a huge impact
2) Should keep both class and mapped with the same tables and change certain external column mapping in classs rule. This will bring less effort change in application. But when I am mapping both class in same table I am getting a warning that already a class has been mapped with the table. Just want to know if this approach is fine.
For better stability purpose, i suggest you to go with first approach. The effort might be huge but it will ensure that you dont get into issues like assignment corruption etc due to wrong mapping.( especially during commit/save)
A class Org-App-Data-Customer can be created and mapped to the common single table which is a result of merge. Direct Inheritance can be configured for both classes Org-App-Data-NCustomer, Org-App-Data-PCustomer from Org-App-Data-Customer. Customer class can be configured as work class or work pool, so that all NCustomer and PCustomer instances will be save into the Customer table.