Project

General

Profile

« Previous | Next » 

Revision b8e7047b

Added by Patrick Plitzner over 7 years ago

ref #5458 Performance increase for taxon node selection

  • by using SqlContainer the nodes are lazily loaded
  • child nodes are loaded via a second SQL query which is filtered for parent_id when expanding a node
  • parent-child relations are cached

View differences:

src/main/java/eu/etaxonomy/cdm/vaadin/util/CdmQueryFactory.java
40 40
    public static final String ID = "id";
41 41
    public static final String UUID_ID = "uuid";
42 42

  
43
    public static QueryDelegate generateTaxonTreeQuery(String name_id, String classificationId) throws SQLException {
44
        String FROM_QUERY = " FROM TaxonBase tb " +
45
                "INNER JOIN TaxonNode tn on tn.taxon_id=tb.id " +
46
                "INNER JOIN TaxonNameBase tnb on tb.name_id=tnb.id " +
47
                "INNER JOIN Classification cl on cl.id=tn.classification_id and cl.id='"+classificationId+"'";
48
        String SELECT_QUERY="SELECT tn.id as " + ID +
49
                ", tb.uuid as " + UUID_ID +
50
                ", tnb.titleCache as " + name_id +
51
                ", tn.parent_id as parent" +
52
                FROM_QUERY;
53
        String COUNT_QUERY = "SELECT count(*) " + FROM_QUERY;
54
        String CONTAINS_QUERY = "SELECT * FROM TaxonBase tb WHERE tb.id = ?";
55

  
56
        return generateQueryDelegate(SELECT_QUERY, COUNT_QUERY, CONTAINS_QUERY);
57
    }
58

  
43 59
    public static QueryDelegate generateTaxonBaseQuery(String name_id,
44 60
            String pb_id,
45 61
            String unp_id,

Also available in: Unified diff