@ Override public long count ( ) throws PersistenceException { logger . debug ( "enter - count()" ) ; try { Transaction xaction = Transaction . getInstance ( true ) ; Counter counter = getCounter ( null ) ; try { Map < String , Object > results ; long count ; results = xaction . execute ( counter , new HashMap < String , Object > ( 0 ) , readDataSource ) ; count = ( ( Number ) results . get ( "count" ) ) . longValue ( ) ; xaction . commit ( ) ; return count ; } finally { xaction . rollback ( ) ; } } finally { logger . debug ( "exit - count()" ) ; } }
Counts the total number of objects governed by this factory in the database .