Class UrlAliasRepositoryImpl
- java.lang.Object
-
- de.digitalcollections.cudami.server.backend.impl.database.AbstractPagingAndSortingRepositoryImpl
-
- de.digitalcollections.cudami.server.backend.impl.jdbi.JdbiRepositoryImpl
-
- de.digitalcollections.cudami.server.backend.impl.jdbi.identifiable.alias.UrlAliasRepositoryImpl
-
- All Implemented Interfaces:
UrlAliasRepository
@Repository public class UrlAliasRepositoryImpl extends JdbiRepositoryImpl implements UrlAliasRepository
-
-
Field Summary
Fields Modifier and Type Field Description static StringMAPPING_PREFIXstatic StringTABLE_ALIASstatic StringTABLE_NAMEstatic StringWEBSITESALIASstatic StringWEBSITESJOIN-
Fields inherited from class de.digitalcollections.cudami.server.backend.impl.jdbi.JdbiRepositoryImpl
dbi, mappingPrefix, tableAlias, tableName
-
Fields inherited from class de.digitalcollections.cudami.server.backend.impl.database.AbstractPagingAndSortingRepositoryImpl
offsetForAlternativePaging
-
-
Constructor Summary
Constructors Constructor Description UrlAliasRepositoryImpl(org.jdbi.v3.core.Jdbi dbi, CudamiConfig cudamiConfig)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intdelete(List<UUID> urlAliasUuids)de.digitalcollections.model.list.paging.PageResponse<de.digitalcollections.model.identifiable.alias.LocalizedUrlAliases>find(de.digitalcollections.model.list.paging.PageRequest pageRequest)de.digitalcollections.model.identifiable.alias.LocalizedUrlAliasesfindAllPrimaryLinks(String slug)de.digitalcollections.model.identifiable.alias.LocalizedUrlAliasesfindPrimaryLinksForWebsite(UUID websiteUuid, String slug, boolean considerLanguage)de.digitalcollections.model.identifiable.alias.LocalizedUrlAliasesgetAllForTarget(UUID uuid)protected List<String>getAllowedOrderByFields()de.digitalcollections.model.identifiable.alias.UrlAliasgetByUuid(UUID uuid)StringgetColumnName(String modelProperty)static StringgetSelectFields(boolean withWebsite)protected StringgetUniqueField()booleanhasUrlAlias(String slug, UUID websiteUuid, Locale targetLanguage)de.digitalcollections.model.identifiable.alias.UrlAliassave(de.digitalcollections.model.identifiable.alias.UrlAlias urlAlias)protected booleansupportsCaseSensitivityForProperty(String modelProperty)Returns whether the passed property can be sorted case sensitive (in general).de.digitalcollections.model.identifiable.alias.UrlAliasupdate(de.digitalcollections.model.identifiable.alias.UrlAlias urlAlias)-
Methods inherited from class de.digitalcollections.cudami.server.backend.impl.jdbi.JdbiRepositoryImpl
addFiltering, addFiltering, addSearchTerm, addSearchTermMappings, count, count, escapeTermForJsonpath, getCommonSearchSql, getFilterClauses, getMappingPrefix, getSearchTermTemplates, getTableAlias, getTableName, getWhereClause, mapFilterExpressionsToOtherTableColumnNames, retrieveNextSortIndexForParentChildren
-
Methods inherited from class de.digitalcollections.cudami.server.backend.impl.database.AbstractPagingAndSortingRepositoryImpl
addOrderBy, addPageRequestParams, getOrderBy
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.digitalcollections.cudami.server.backend.api.repository.identifiable.alias.UrlAliasRepository
findPrimaryLinksForWebsite
-
-
-
-
Field Detail
-
MAPPING_PREFIX
public static final String MAPPING_PREFIX
- See Also:
- Constant Field Values
-
TABLE_ALIAS
public static final String TABLE_ALIAS
- See Also:
- Constant Field Values
-
TABLE_NAME
public static final String TABLE_NAME
- See Also:
- Constant Field Values
-
WEBSITESALIAS
public static final String WEBSITESALIAS
- See Also:
- Constant Field Values
-
WEBSITESJOIN
public static final String WEBSITESJOIN
-
-
Constructor Detail
-
UrlAliasRepositoryImpl
@Autowired public UrlAliasRepositoryImpl(org.jdbi.v3.core.Jdbi dbi, CudamiConfig cudamiConfig)
-
-
Method Detail
-
getSelectFields
public static String getSelectFields(boolean withWebsite)
-
delete
public int delete(List<UUID> urlAliasUuids) throws UrlAliasRepositoryException
- Specified by:
deletein interfaceUrlAliasRepository- Throws:
UrlAliasRepositoryException
-
find
public de.digitalcollections.model.list.paging.PageResponse<de.digitalcollections.model.identifiable.alias.LocalizedUrlAliases> find(de.digitalcollections.model.list.paging.PageRequest pageRequest) throws UrlAliasRepositoryException- Specified by:
findin interfaceUrlAliasRepository- Throws:
UrlAliasRepositoryException
-
findAllPrimaryLinks
public de.digitalcollections.model.identifiable.alias.LocalizedUrlAliases findAllPrimaryLinks(String slug) throws UrlAliasRepositoryException
- Specified by:
findAllPrimaryLinksin interfaceUrlAliasRepository- Throws:
UrlAliasRepositoryException
-
findPrimaryLinksForWebsite
public de.digitalcollections.model.identifiable.alias.LocalizedUrlAliases findPrimaryLinksForWebsite(UUID websiteUuid, String slug, boolean considerLanguage) throws UrlAliasRepositoryException
- Specified by:
findPrimaryLinksForWebsitein interfaceUrlAliasRepository- Throws:
UrlAliasRepositoryException
-
getAllForTarget
public de.digitalcollections.model.identifiable.alias.LocalizedUrlAliases getAllForTarget(UUID uuid) throws UrlAliasRepositoryException
- Specified by:
getAllForTargetin interfaceUrlAliasRepository- Throws:
UrlAliasRepositoryException
-
getAllowedOrderByFields
protected List<String> getAllowedOrderByFields()
- Specified by:
getAllowedOrderByFieldsin classAbstractPagingAndSortingRepositoryImpl- Returns:
- model properties names that are applicable for sorting, will be mapped to database column names using @see #getColumnName
-
getByUuid
public de.digitalcollections.model.identifiable.alias.UrlAlias getByUuid(UUID uuid) throws UrlAliasRepositoryException
- Specified by:
getByUuidin interfaceUrlAliasRepository- Throws:
UrlAliasRepositoryException
-
getColumnName
public String getColumnName(String modelProperty)
- Specified by:
getColumnNamein classAbstractPagingAndSortingRepositoryImpl- Parameters:
modelProperty- name of model property passed as String, e.g. "lastModified"- Returns:
- full qualified column name as used in sql queries ("last_modified" or e.g. "w.last_modified" if prefix used in queries)
-
getUniqueField
protected String getUniqueField()
- Specified by:
getUniqueFieldin classAbstractPagingAndSortingRepositoryImpl- Returns:
- name of model property that guarantees an unique sorting, e.g. a db primary key or another unique column/field
-
hasUrlAlias
public boolean hasUrlAlias(String slug, UUID websiteUuid, Locale targetLanguage) throws UrlAliasRepositoryException
- Specified by:
hasUrlAliasin interfaceUrlAliasRepository- Throws:
UrlAliasRepositoryException
-
save
public de.digitalcollections.model.identifiable.alias.UrlAlias save(de.digitalcollections.model.identifiable.alias.UrlAlias urlAlias) throws UrlAliasRepositoryException- Specified by:
savein interfaceUrlAliasRepository- Throws:
UrlAliasRepositoryException
-
supportsCaseSensitivityForProperty
protected boolean supportsCaseSensitivityForProperty(String modelProperty)
Description copied from class:AbstractPagingAndSortingRepositoryImplReturns whether the passed property can be sorted case sensitive (in general). This method should be kept in sync withAbstractPagingAndSortingRepositoryImpl.getAllowedOrderByFields().- Specified by:
supportsCaseSensitivityForPropertyin classAbstractPagingAndSortingRepositoryImpl- Parameters:
modelProperty- the property name (similar toAbstractPagingAndSortingRepositoryImpl.getColumnName(java.lang.String))- Returns:
trueonly if case (in)sensitive sorting is possible
-
update
public de.digitalcollections.model.identifiable.alias.UrlAlias update(de.digitalcollections.model.identifiable.alias.UrlAlias urlAlias) throws UrlAliasRepositoryException- Specified by:
updatein interfaceUrlAliasRepository- Throws:
UrlAliasRepositoryException
-
-