Class JdbiRepositoryImpl

    • Field Detail

      • dbi

        protected final org.jdbi.v3.core.Jdbi dbi
      • mappingPrefix

        protected final String mappingPrefix
      • tableAlias

        protected final String tableAlias
      • tableName

        protected final String tableName
    • Constructor Detail

      • JdbiRepositoryImpl

        public JdbiRepositoryImpl​(org.jdbi.v3.core.Jdbi dbi,
                                  String tableName,
                                  String tableAlias,
                                  String mappingPrefix,
                                  int offsetForAlternativePaging)
    • Method Detail

      • addFiltering

        public void addFiltering​(de.digitalcollections.model.list.paging.PageRequest pageRequest,
                                 StringBuilder sqlQuery,
                                 Map<String,​Object> argumentMappings)
      • addFiltering

        public void addFiltering​(de.digitalcollections.model.list.filtering.Filtering filtering,
                                 StringBuilder sqlQuery,
                                 Map<String,​Object> argumentMappings)
      • addSearchTerm

        protected String addSearchTerm​(de.digitalcollections.model.list.paging.PageRequest pageRequest,
                                       StringBuilder innerQuery,
                                       Map<String,​Object> argumentMappings)
      • count

        public long count()
      • escapeTermForJsonpath

        protected final String escapeTermForJsonpath​(String term)
        Escape characters that must not appear in jsonpath inner strings.

        This method should always be used to clean up strings, e.g. search terms, that are intended to appear in an jsonpath inner string, i.e. between double quotes. If the inserted term contains double quotes then the jsonpath breaks. Hence we remove double quotes at start and end of the provided string (they do not have any meaning for the search at all) and escape the remaining ones with a backslash.

        Parameters:
        term - can be null
        Returns:
        term with forbidden characters removed or escaped
      • getCommonSearchSql

        public String getCommonSearchSql​(String tblAlias,
                                         String originalSearchTerm)
      • getFilterClauses

        protected String getFilterClauses​(de.digitalcollections.model.list.filtering.Filtering filtering,
                                          Map<String,​Object> argumentMappings)
      • getMappingPrefix

        public String getMappingPrefix()
      • getSearchTermTemplates

        protected List<String> getSearchTermTemplates​(String tableAlias,
                                                      String originalSearchTerm)
      • getTableAlias

        public String getTableAlias()
      • getTableName

        public String getTableName()
      • mapFilterExpressionsToOtherTableColumnNames

        protected void mapFilterExpressionsToOtherTableColumnNames​(de.digitalcollections.model.list.filtering.Filtering filtering,
                                                                   AbstractPagingAndSortingRepositoryImpl otherRepository)
      • retrieveNextSortIndexForParentChildren

        protected Integer retrieveNextSortIndexForParentChildren​(org.jdbi.v3.core.Jdbi dbi,
                                                                 String tableName,
                                                                 String columNameParentUuid,
                                                                 UUID parentUuid)