title: Query annotation is disallowed for this location
body: <p>New to Spring .. </p>
  
  <p>Trying to use the @Query annotation but get a message of:
  The annotation @Query is disallowed for this location</p>
  
  <p>Got to be some setup or configuration I am missing here is what I have:</p>
  
  <p>pom.xml</p>
  
  <pre><code>&lt;parent&gt;
   &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
   &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
   &lt;version&gt;1.5.2.RELEASE&lt;/version&gt;
   &lt;relativePath/&gt;
  &lt;/parent&gt;
  … to dependency:
  &lt;dependency&gt;
    &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
    &lt;artifactId&gt;spring-boot-starter-data-jpa&lt;/artifactId&gt;      
  &lt;/dependency&gt;
  </code></pre>
  
  <p>Compelled to use 1.5.2.RELEASE as it is the employer's current standard
  Looking in the Maven dependences I see:
  hibernate-core-5.0.12.Final
  hibernate-jpa-2.1-api-1.0.0.Final.jar
  spring-data-jpa-1.11.1.RELEASE.jar
  + many others</p>
  
  <p>in some of the examples I have seen it seems like a easy matter to add the @Query annotation however it does not seem to work. currently I have just a entity, repo, controller and a main.</p>
  
  <p>I have tried the @Repository but it does not seem to make a difference</p>
  
  <p>here's the repo</p>
  
  <pre><code>public interface DeptRepo extends JpaRepository&lt;Dept, Long&gt; {
  
  @Query(value = "select d from dept d where name = 'ACCOUNTING'")
  List&lt;Dept&gt; findByAccounting;
  }
  </code></pre>
  
  <p>application properties</p>
  
  <pre><code>spring.jpa.show_sql=true
  spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.Oracle12cDialect
  spring.datasource.url=jdbc:oracle:thin:@localhost:1521/to2b
  spring.datasource.username=scott
  spring.datasource.password=tiger
  </code></pre>
  
  <p>My question is what is the setup info I am missing?</p>