Added a function to CRUDObject to be able to count the number of objects in the database.