コード例 #1
0
 @Test
 public void testAnnotatedQueryUsageWithoutExplicitAttribute() throws Exception {
   SolrQueryMethod method =
       getQueryMethodByName("findByAnnotatedQueryWithoutExplicitAttribute", String.class);
   Assert.assertTrue(method.hasAnnotatedQuery());
   Assert.assertFalse(method.hasAnnotatedNamedQueryName());
   Assert.assertFalse(method.hasFilterQuery());
   Assert.assertEquals("name:?0", method.getAnnotatedQuery());
 }
コード例 #2
0
 @Test
 public void testAnnotatedQueryUsage() throws Exception {
   SolrQueryMethod method = getQueryMethodByName("findByAnnotatedQuery", String.class);
   Assert.assertTrue(method.hasAnnotatedQuery());
   Assert.assertFalse(method.hasAnnotatedNamedQueryName());
   Assert.assertFalse(method.hasProjectionFields());
   Assert.assertFalse(method.hasFilterQuery());
   Assert.assertEquals("name:?0", method.getAnnotatedQuery());
 }
コード例 #3
0
 @Test
 public void testWithMultipleFieldsProjection() throws Exception {
   SolrQueryMethod method =
       getQueryMethodByName("findByAnnotatedQueryWithProjectionOnMultipleFields", String.class);
   Assert.assertTrue(method.hasAnnotatedQuery());
   Assert.assertTrue(method.hasProjectionFields());
   Assert.assertFalse(method.hasFilterQuery());
   Assert.assertEquals(2, method.getProjectionFields().size());
   Assert.assertFalse(method.hasAnnotatedNamedQueryName());
   Assert.assertEquals("name:?0", method.getAnnotatedQuery());
 }
コード例 #4
0
 public StringBasedSolrQuery(SolrQueryMethod method, SolrOperations solrOperations) {
   this(method.getAnnotatedQuery(), method, solrOperations);
 }