@ SuppressWarnings ( "unchecked" ) static void findByQuery ( final EntityManager em , final String query ) { Query q = em . createNamedQuery ( query ) ; logger . info ( "[On Find All by Query]" ) ; List < User > users = q . getResultList ( ) ; if ( users == null || users . isEmpty ( ) ) { logger . info ( "0 Users Returned" ) ; return ; } System . out . println ( "#######################START##########################################" ) ; logger . info ( "\t\t Total number of users:" + users . size ( ) ) ; logger . info ( "\t\t User's total tweets:" + users . get ( 0 ) . getTweets ( ) . size ( ) ) ; printTweets ( users ) ; logger . info ( "\n" ) ; // logger.info("First tweet:" users.get(0).getTweets().); System . out . println ( "#######################END############################################" ) ; logger . info ( "\n" ) ; }
on find by wild search query .