Commit 66ee2c95 authored by Matija Obreza's avatar Matija Obreza
Browse files

lower() doesn't hit database index

parent c23f0499
......@@ -32,37 +32,37 @@ public interface Taxonomy2Repository extends JpaRepository<Taxonomy2, Long> {
@Query("select distinct t.genus from Taxonomy2 t where t.genus like ?1")
List<String> autocompleteGenus(String term, Pageable page);
@Query("select distinct t.genus from Taxonomy2 t join t.cropTaxonomies ct where lower(t.genus) like lower(?1) and ct.crop = ?2")
@Query("select distinct t.genus from Taxonomy2 t join t.cropTaxonomies ct where t.genus like ?1 and ct.crop = ?2")
List<String> autocompleteGenusByCrop(String term, Crop crop, Pageable page);
@Query("select distinct t.species from Taxonomy2 t where lower(t.species) like lower(?1)")
@Query("select distinct t.species from Taxonomy2 t where t.species like ?1)")
List<String> autocompleteSpecies(String term, Pageable page);
@Query("select distinct t.species from Taxonomy2 t join t.cropTaxonomies ct where lower(t.species) like lower(?1) and ct.crop = ?2")
@Query("select distinct t.species from Taxonomy2 t join t.cropTaxonomies ct where t.species like ?1 and ct.crop = ?2")
List<String> autocompleteSpeciesByCrop(String term, Crop crop, Pageable page);
@Query("select distinct t.species from Taxonomy2 t where lower(t.species) like lower(?1) and t.genus in (?2)")
@Query("select distinct t.species from Taxonomy2 t where t.species like ?1 and t.genus in (?2)")
List<String> autocompleteSpeciesByGenus(String term, List<String> genus, Pageable page);
@Query("select distinct t.taxonName from Taxonomy2 t where lower(t.taxonName) like lower(?1)")
@Query("select distinct t.taxonName from Taxonomy2 t where t.taxonName like ?1)")
List<String> autocompleteTaxonomy(String term, Pageable page);
@Query("select distinct t.subtaxa from Taxonomy2 t where lower(t.subtaxa) like lower(?1)")
@Query("select distinct t.subtaxa from Taxonomy2 t where t.subtaxa like ?1)")
List<String> autocompleteSubtaxa(String string, Pageable page);
@Query("select distinct t.subtaxa from Taxonomy2 t join t.cropTaxonomies ct where lower(t.subtaxa) like lower(?1) and ct.crop = ?2")
@Query("select distinct t.subtaxa from Taxonomy2 t join t.cropTaxonomies ct where t.subtaxa like ?1 and ct.crop = ?2")
List<String> autocompleteSubtaxaByCrop(String string, Crop crop, Pageable page);
@Query("select distinct t.subtaxa from Taxonomy2 t where lower(t.subtaxa) like lower(?1) and t.genus in (?2)")
@Query("select distinct t.subtaxa from Taxonomy2 t where t.subtaxa like ?1 and t.genus in (?2)")
List<String> autocompleteSubtaxaByGenus(String string, List<String> genus, Pageable page);
@Query("select distinct t.subtaxa from Taxonomy2 t where lower(t.subtaxa) like lower(?1) and t.species in (?2)")
@Query("select distinct t.subtaxa from Taxonomy2 t where t.subtaxa like ?1 and t.species in (?2)")
List<String> autocompleteSubtaxaBySpecies(String string, List<String> species, Pageable page);
@Query("select distinct t.subtaxa from Taxonomy2 t where lower(t.subtaxa) like lower(?1) and t.genus in (?2) and t.species in (?3)")
@Query("select distinct t.subtaxa from Taxonomy2 t where t.subtaxa like ?1 and t.genus in (?2) and t.species in (?3)")
List<String> autocompleteSubtaxaByGenusAndSpecies(String string, List<String> genus, List<String> species, Pageable page);
@Query("select t from Taxonomy2 t where lower(t.genus) = lower(?1) and lower(t.species) = lower(?2) and lower(t.spAuthor) = lower(?3) and lower(t.subtaxa) = lower(?4) and lower(t.subtAuthor) = lower(?5)")
@Query("select t from Taxonomy2 t where t.genus = ?1 and t.species = ?2 and t.spAuthor = ?3 and t.subtaxa = ?4 and t.subtAuthor = ?5")
Taxonomy2 findByGenusAndSpeciesAndSpAuthorAndSubtaxaAndSubtAuthor(String genus, String species, String spAuthor, String subtaxa, String subtAuthor);
List<Taxonomy2> findByGenus(String genus);
......
......@@ -205,7 +205,7 @@
<c:out value="${crop.getName(pageContext.response.locale)}" />
</a>
</li>
<%-- ${cropCount / 3} ${cropCount / 3 == 0} idx=${status.count} --%>
<!-- ${cropCount / 3} ${cropCount / 3 == 0} idx=${status.count} -->
<c:if test="${status.count % (cropCount / 3) == 0}">
</div>
<div class="col-md-12">
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment