title: spring jpa pageable sort PropertyReferenceException
body: <p>I have a spring boot project and I use spring JPA. I have this model <code>Receipt</code> which has a column <code>TransactionDate</code> which its database column name is <code>transaction_date</code>. I'm calling the <code>findAll(Predicate predicate, Pageable pageable)</code> to get the desired data page. </p>
  
  <p>It works completely fine when I create my predicate using the <code>BooleanBuilder</code> in my ReceiptService and passes it with the <code>PageRequest</code> without a sort it works fine but the moment I add a sort to it, it will throw the below exception:</p>
  
  <p><code>org.springframework.data.mapping.PropertyReferenceException: No property transaction found for type Receipt!</code></p>
  
  <p>and this is how I created my PageRequest</p>
  
  <pre><code>org.springframework.data.domain.Pageable pageable = new PageRequest(
          0, 
          10,
          Direction.DESC,
          "transaction_date");
  </code></pre>
  
  <p>and this is what my pageable looks like when I look at it in the debug mode</p>
  
  <pre><code>Page request [number: 0, size 10, sort: transaction_date: DESC]
  </code></pre>
  
  <p>but then from the exception it seems that it's cutting it from the _ </p>
  
  <p>here is my repository function: (since the conditions are coming from a search box which might have some other fields null or have a value, I realized it's easy to do it using the predicate)</p>
  
  <pre><code>public Page&lt;Receipt&gt; findAll(Predicate predicate, org.springframework.data.domain.Pageable pageable);
  </code></pre>
  
  <p>here is the Receipt Entity</p>
  
  <pre><code>@Entity
  public class Receipt extends Base {
  
  @Column(name="email")
  private String Email;
  
  @Column(name="bsid")
  private String Bsid;
  
  
  @Column(name="snap_shot")
  private String SnapShot;
  
  @Column(name="transaction_date")
  private Date TransactionDate;
  
  @Column(name="reference_number")
  private String ReferenceNumber;
  
  @Column(name="total_amount")
  private Double TotalAmount;
  
  @Column(name="submitted_by_user")
  private boolean SubmittedByUser;
  
  @Column(name="approval_date")
  private Date ApprovalDate;
  
  @ManyToOne
  @JoinColumn(name="user_id")
  private User User;
  
  @ManyToOne
  @JoinColumn(name="store_id")
  private Store Store;
  
  @Column(name="pending")
  private boolean Pending;
  
  @Column(name="declined")
  private boolean Declined;
  
  @Column(name="approved")
  private boolean Approved;
  
  public String getEmail() {
      return Email;
  }
  
  public void setEmail(String email) {
      Email = email.trim();
  }
  
  public String getBsid() {
      return Bsid;
  }
  
  public void setBsid(String bsid) {
      Bsid = bsid.trim();
  }
  
  public String getSnapShot() {
      return SnapShot;
  }
  
  public void setSnapShot(String snapShot) {
      SnapShot = snapShot.trim();
  }
  
  public Store getStore() {
      return Store;
  }
  
  public void setStore(Store store) {
      Store = store;
  }
  
  public Date getTransactionDate() {
      return TransactionDate;
  }
  
  public void setTransactionDate(Date transactionDate) {
      TransactionDate = transactionDate;
  }
  
  public String getReferenceNumber() {
      return ReferenceNumber;
  }
  
  public void setReferenceNumber(String referenceNumber) {
      ReferenceNumber = referenceNumber.trim();
  }
  
  public Double getTotalAmount() {
      return TotalAmount;
  }
  
  public void setTotalAmount(Double totalAmount) {
      TotalAmount = totalAmount;
  }
  
  public boolean isSubmittedByUser() {
      return SubmittedByUser;
  }
  
  public void setSubmittedByUser(boolean submittedByUser) {
      SubmittedByUser = submittedByUser;
  }
  
  public User getUser() {
      return User;
  }
  
  public void setUser(User user) {
      User = user;
  }
  
  public boolean isPending() {
      return Pending;
  }
  
  public void setPending(boolean pending) {
      Pending = pending;
  }
  
  public boolean isDeclined() {
      return Declined;
  }
  
  public void setDeclined(boolean declined) {
      Declined = declined;
  }
  
  public boolean isApproved() {
      return Approved;
  }
  
  public void setApproved(boolean approved) {
      Approved = approved;
  }
  
  public Date getApprovalDate() {
      return ApprovalDate;
  }
  
  public void setApprovalDate(Date approvalDate) {
      ApprovalDate = approvalDate;
  }
  }
  </code></pre>