top of page

Decoding Pega's Obj Methods: How Database Operations Work

Ever wonder how Pega saves values when you execute Obj-Save or how Pega retrieves the data from a database table when you do Obj-Open or Obj-Browse? In this blog, let's dig deeper into this question. If you pay attention to the syntax of Obj methods, we don't find the name of the DB table where this method will perform their operation.

For example, in the Obj-Browse method, we don't mention the database table name. So, how does Pega know which table to access for the data? The answer is the class name. But how does the class name help identify the table name? You can discover this by following the steps below.


  1. First open a class in App Explorer view.

  2. Right click on Class name and click - Definition.

  3. It will open, the class definition.

  4. ree
  5. Click on Test Connection button.

  6. This will open a pop up which will show the Class name and its linked DB table. Pls note both Schema and table name.

  7. ree

Once the database table is obtained, how does the Obj method determine which column of the database table to use for operations? The answer is that each property of the concrete class is mapped to the database table. This mapping can also be verified in Pega Designer Studio.


Select Configure-> System-> Database->Modify Schema

ree

Modify Schema will allow you to see the list of properties a concrete class has and which DB column each property is mapped to. It also helps by showing DB column details like datatype, its length, etc. To get all these details, you need to first select the schema where the DB table is created. From the above steps, you will come to know the DB table name and the schema where the table is created. Using this information, you select the schema and click the Next button.

ree

Select the DB table you want to enquire about. This information you know from the previous steps.

ree

Click Next button at the bottom. Next you will see the class name and total properties this particular class has.

ree

Click on the number and you see screen like below. Each row in this screen show property name and corresponding Column name is it linked to.

ree

In conclusion, understanding how Pega maps classes to database tables and properties to columns is crucial for efficient application development. By following the outlined steps, you can gain deeper insights into the inner workings of Obj methods and their interactions with the database. This knowledge not only enhances your technical expertise but also empowers you to troubleshoot and optimize your Pega applications effectively.






Comments


©2022 by pegablogs. Proudly created with Wix.com

bottom of page