Question
BMO
US
Last activity: 13 Feb 2024 9:00 EST
How to create a database view that search two classes
Hello Community,
My apologies if this is a trivial question, I'm new and have searched around.
I'm trying to create a database view in pega platform Dev Studio so I can map my report definition to the view, but I'm not understanding the relationship between classes and tables. Can someone clarify?
I have two classes, AA-BB-C-DE and AA-BB-C-BB, that both save data to the same PegaData database named MyTable. There exists a record that is saved in either DE or BB class, but never both; I need to create a view that selects that record. So essentially the SQL query that I need is something like this:
select pyid from AA-BB-C-DE where pyid is not null UNION select pyid from AA-BB-C-BB where pyid is not null
Since both classes are connected to the same table (MyTable) my first thought was to create the view under AA-BB-C.
The problem is that when I check the Database Class Mappings under Configure > Data Model > Class & Properties > Database Class Mappings, I see that the class AA-BB-C is connected to a different PegaData database named pc_AA_BB_C that contains no records. Yet, classes DE and BB are connected to MyTable and contain many records.
What am I not understanding? Where is the property place to create this view?