code: public static AuditDto transformToDto(Audit audit) {
          if (audit == null) {
              throw new WebApplicationException("Null entity object cannot be converted to Dto object.", Status.INTERNAL_SERVER_ERROR);
          }
  
          AuditDto auditDto = new AuditDto();
  
          try {
          	    auditDto.setId(audit.getId());
          	    auditDto.setHostName(audit.getHostName());
          	    auditDto.setMessage(audit.getMessage());
          	    auditDto.setCreatedDate(audit.getCreatedDate());
              auditDto.setEntityId(audit.getEntityId());
          } catch (Exception ex) {
              throw new WebApplicationException("DTO transformation failed.", Status.INTERNAL_SERVER_ERROR);
          }
          return auditDto;
      }
docs: Converts the audit entity to DTO.
  
  @param   audit  The audit entity.
  
  @return  The audit DTO.
  
  @throws  WebApplicationException  If an error occurs.