#127 autocomplete
parent
512a805e8c
commit
24a1276005
@ -0,0 +1,42 @@
|
|||||||
|
package ru.ulstu.paper.model;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
public class AutoCompleteData {
|
||||||
|
ArrayList<String> authors = new ArrayList<>();
|
||||||
|
ArrayList<String> publicationTitles = new ArrayList<>();
|
||||||
|
ArrayList<String> publishers = new ArrayList<>();
|
||||||
|
ArrayList<String> journalOrCollectionTitles = new ArrayList<>();
|
||||||
|
|
||||||
|
public ArrayList<String> getAuthors() {
|
||||||
|
return authors;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAuthors(ArrayList<String> authors) {
|
||||||
|
this.authors = authors;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArrayList<String> getPublicationTitles() {
|
||||||
|
return publicationTitles;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPublicationTitles(ArrayList<String> publicationTitles) {
|
||||||
|
this.publicationTitles = publicationTitles;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArrayList<String> getPublishers() {
|
||||||
|
return publishers;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPublishers(ArrayList<String> publishers) {
|
||||||
|
this.publishers = publishers;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArrayList<String> getJournalOrCollectionTitles() {
|
||||||
|
return journalOrCollectionTitles;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setJournalOrCollectionTitles(ArrayList<String> journalOrCollectionTitles) {
|
||||||
|
this.journalOrCollectionTitles = journalOrCollectionTitles;
|
||||||
|
}
|
||||||
|
}
|
@ -1,8 +1,23 @@
|
|||||||
package ru.ulstu.paper.repository;
|
package ru.ulstu.paper.repository;
|
||||||
|
|
||||||
import org.springframework.data.jpa.repository.JpaRepository;
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
import org.springframework.data.jpa.repository.Query;
|
||||||
import ru.ulstu.paper.model.Reference;
|
import ru.ulstu.paper.model.Reference;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
public interface ReferenceRepository extends JpaRepository<Reference, Integer> {
|
public interface ReferenceRepository extends JpaRepository<Reference, Integer> {
|
||||||
void deleteById(Integer id);
|
void deleteById(Integer id);
|
||||||
|
|
||||||
|
@Query("SELECT DISTINCT r.authors FROM Reference r")
|
||||||
|
ArrayList<String> findDistinctAuthors();
|
||||||
|
|
||||||
|
@Query("SELECT DISTINCT r.publicationTitle FROM Reference r")
|
||||||
|
ArrayList<String> findDistinctPublicationTitles();
|
||||||
|
|
||||||
|
@Query("SELECT DISTINCT r.publisher FROM Reference r")
|
||||||
|
ArrayList<String> findDistinctPublishers();
|
||||||
|
|
||||||
|
@Query("SELECT DISTINCT r.journalOrCollectionTitle FROM Reference r where r.journalOrCollectionTitle <> ''")
|
||||||
|
ArrayList<String> findDistinctJournalOrCollectionTitles();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue