Use one BO for multiple exact tables?


Author
Message
Michael Reese
Michael Reese
StrataFrame User (403 reputation)StrataFrame User (403 reputation)StrataFrame User (403 reputation)StrataFrame User (403 reputation)StrataFrame User (403 reputation)StrataFrame User (403 reputation)StrataFrame User (403 reputation)StrataFrame User (403 reputation)StrataFrame User (403 reputation)
Group: StrataFrame Users
Posts: 235, Visits: 1.6K
Hi I have a database with multiple tables that are exactely the same but have different names in the same database. Ie. MIC_Segment_PID and GENLAB_Segment_PID. Can I create one BO called Segment_PID and on demand, map it to the  MIC_Segment_PID and GENLAB_Segment_PID tables in the database without creating native BOs for the tables?

Michael
Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Option #1
Well, it is possible, but I would recommend creating one BO for each table.  If you are going to have some common logic (i.e. methods, etc) that you want to share, then I would create a base BO that these 4 BOs inherit from.  Next, create 4 BOs and map them so they all get the property descriptors, SPROC mapping, etc. all lined up correctly.  Since they have different names it is easier to do this. 

Option #2
If you want to create a single BO, then you will have to override the TableName property that is generated, along with anything that directly relates to that table name (i.e. sprocs, CRUD settings, etc).  You can then dynamically manipulate the BO for your desired table name.

But the easiest and safest way is to go with Option #1
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search