Although it is discouraged to use the count method of mboSet as it hits the database to get the count but at times it can be very useful. There is an overloaded method count(int countConstant) that can be used to get the count of mbos that are in different state in the mboset.
Here is the explanation of the parameter –
countConstant
– one of the constants from psdi.mbo.MboConstants
. The list below shows each constant and describes the count returned for each.
- COUNT_DATABASE — The count from the database.
- COUNT_ADDITIONS — The count of newly added Mbos that have not yet been saved.
- COUNT_DELETED — The count of Mbos marked for deletion that have not yet been saved.
- COUNT_EXISTING — The sum of the count from the database (
COUNT_DATABASE
) plus newly added Mbos that have not yet been saved (COUNT_ADDITIONS
). - COUNT_AFTERSAVE — The number of Mbos that is anticipated to be in this MboSet after saving. Equals the sum of the count from the database (
COUNT_DATABASE
) plus newly added Mbos that have not yet been saved (COUNT_ADDITIONS
) minus Mbos marked for deletion that have not yet been saved (COUNT_DELETED
).
The count() method without the parameter is Same as count(COUNT_EXISTING).