public static ServiceManagementRecord findServiceManagementRecord ( EntityManager em , Service service ) { requireArgument ( em != null , "Entity manager can not be null." ) ; requireArgument ( service != null , "Service cannot be null." ) ; TypedQuery < ServiceManagementRecord > query = em . createNamedQuery ( "ServiceManagementRecord.findByService" , ServiceManagementRecord . class ) ; try { query . setParameter ( "service" , service ) ; return query . getSingleResult ( ) ; } catch ( NoResultException ex ) { return null ; } }
Returns a record for the specified service .