What is the use of findbyprimarykey()?

Showing Answers 1 - 1 of 1 Answers

The findByPrimaryKey() method works like the read() method, except that the findByPrimaryKey() method retrieves a single TxObject directly from the database using a primary key without going through a TxCursor. The primary key can be any primary key. For example, RealmId is the official primary key for the PIRealm table. Because the realm name is unique, it can also be used as an alternate primary key to retrieve a realm.

You decide what the primary key will be. However, the object must exist, and it must be unique. For example, to use the findByPrimaryKey() method to find subscribers using their daytime telephone numbers, you must ensure that each daytime telephone number is unique.

You can combine the findByPrimaryKey() method with the read(TxObject) method.

Reference:  Click here 

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions