Friday, February 2, 2007

What is the use of findby primarykey ()?

The findByPrimaryKey () method works like the read () method, except that the findByPrimaryKey () method retrieves a single TX Object directly from the database using a primary key without going through a TX Cursor. The primary key can be any primary key. For example, RealmId is the official 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 (TX Object) method.

SOURCE : www.referjava.com

No comments: