title: Setup X-Total-Count with Spring Data REST
body: <p>I'm testing Spring Data REST.
  I was following <a href="https://spring.io/guides/gs/accessing-data-rest/" rel="nofollow noreferrer">this tutorial</a> to understand how it works.</p>
  
  <p>The code so far is simple as:</p>
  
  <pre><code>@Entity
  @SequenceGenerator(name="my_seq", sequenceName="user_id_seq")
  @Table(name = "employees")
  data class Employee (@Id @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "my_seq") val id: Long? = null,
                       val name: String = "defConstructorHell")
  </code></pre>
  
  <p>and when I ask with <code>GET</code> I obtain the following json:</p>
  
  <pre><code>{
    "_embedded" : {
      "employees" : [ {
        "name" : "ciao",
        "_links" : {
          "self" : {
            "href" : "http://localhost:5000/api/employees/1"
          },
          "employee" : {
            "href" : "http://localhost:5000/api/employees/1"
          }
        }
      } ]
    },
    "_links" : {
      "self" : {
        "href" : "http://localhost:5000/api/employees{?page,size,sort}",
        "templated" : true
      },
      "profile" : {
        "href" : "http://localhost:5000/api/profile/employees"
      }
    },
    "page" : {
      "size" : 20,
      "totalElements" : 1,
      "totalPages" : 1,
      "number" : 0
    }
  }
  </code></pre>
  
  <p>Which is totally fine but I'm using a js framework that requires the header X-Total-Count.</p>
  
  <p>Do you know if there is a way of doing it wi Spring Data REST?</p>