code: @Transactional
      public static ServiceManagementRecord updateServiceManagementRecord(EntityManager em, ServiceManagementRecord record) {
          SystemAssert.requireArgument(em != null, "Entity manager can not be null.");
          SystemAssert.requireArgument(record != null, "ServiceManagementRecord cannot be null.");
  
          TypedQuery<ServiceManagementRecord> query = em.createNamedQuery("ServiceManagementRecord.findByService", ServiceManagementRecord.class);
  
          query.setParameter("service", record.getService());
          try {
              ServiceManagementRecord oldRecord = query.getSingleResult();
  
              oldRecord.setEnabled(record.isEnabled());
              return em.merge(oldRecord);
          } catch (NoResultException ex) {
              return em.merge(record);
          }
      }
docs: Updates the ServiceManagementRecord entity.
  
  @param   em      Entity manager. Cannot be null.
  @param   record  serviceManagementRecord object. Cannot be null.
  
  @return  updated ServiceManagementRecord entity.