title: Spring Security principal cannot be found from SpEL
body: <p>I want to get data from <code>CrudRepository</code> for <code>RestResource</code> by a JPA Query: </p>
  
  <pre><code>public interface IContactRepository extends PagingAndSortingRepository&lt;Contact, Long&gt; {
  
      @Query("select contact from Contact contact where contact.owner.login = ?#{principal.username}")
      @RestResource( path = "my")
      List&lt;Contact&gt; findByOwner();
  }
  </code></pre>
  
  <p>But I get this: </p>
  
  <blockquote>
    <p>Property or field 'principal' cannot be found on object of type
    'java.lang.Object[]' - maybe not public?</p>
  </blockquote>
  
  <p>I can get principal directly: </p>
  
  <pre><code>SecurityContextHolder.getContext().getAuthentication().getPrincipal()
  </code></pre>
  
  <p>but I need it inside the interface to get direct access to <code>RestResource</code>.</p>