code: @GET
      @Path("/entity/{entityid}")
      @Description("Returns the audit trail for an entity.")
      @Produces(MediaType.APPLICATION_JSON)
      public List<AuditDto> findByEntityId(@PathParam("entityid") BigInteger entityid,
          @QueryParam("limit") BigInteger limit) {
          if (entityid == null || entityid.compareTo(BigInteger.ZERO) < 1) {
              throw new WebApplicationException("Entity ID cannot be null and must be a positive non-zero number.", Status.BAD_REQUEST);
          }
          if (limit != null && limit.compareTo(BigInteger.ZERO) < 1) {
              throw new WebApplicationException("Limit must be a positive non-zero number.", Status.BAD_REQUEST);
          }
  
          List<Audit> auditList = limit == null ? _auditService.findByEntity(entityid) : _auditService.findByEntity(entityid, limit);
  
          if (auditList != null && auditList.size() > 0) {
              return AuditDto.transformToDto(auditList);
          } else {
              throw new WebApplicationException(Response.Status.NOT_FOUND.getReasonPhrase(), Response.Status.NOT_FOUND);
          }
      }
docs: Returns the audit record for the given id.
  
  @param   entityid  The entity Id. Cannot be null.
  @param   limit     max no of records
  
  @return  The audit object.
  
  @throws  WebApplicationException  Throws the exception for invalid input data.