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
-
-
Constructor Summary
Constructors Constructor Description UrlAliasRepositoryImpl(org.jdbi.v3.core.Jdbi dbi)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intdelete(List<UUID> urlAliasUuids)de.digitalcollections.model.paging.SearchPageResponse<de.digitalcollections.model.identifiable.alias.LocalizedUrlAliases>find(de.digitalcollections.model.paging.SearchPageRequest searchPageRequest)de.digitalcollections.model.identifiable.alias.LocalizedUrlAliasesfindAllForTarget(UUID uuid)de.digitalcollections.model.identifiable.alias.LocalizedUrlAliasesfindAllPrimaryLinks(String slug)de.digitalcollections.model.identifiable.alias.UrlAliasfindOne(UUID uuid)de.digitalcollections.model.identifiable.alias.LocalizedUrlAliasesfindPrimaryLinksForWebsite(UUID websiteUuid, String slug, boolean considerLanguage)protected List<String>getAllowedOrderByFields()protected 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)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, count, getFilterClauses, getMappingPrefix, getTableAlias, getTableName, getWhereClause, retrieveNextSortIndexForParentChildren
-
Methods inherited from class de.digitalcollections.cudami.server.backend.impl.database.AbstractPagingAndSortingRepositoryImpl
addLimit, addOffset, 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
-
TABLE_NAME
public static final String TABLE_NAME
- See Also:
- Constant Field Values
-
TABLE_ALIAS
public static final String TABLE_ALIAS
- See Also:
- Constant Field Values
-
MAPPING_PREFIX
public static final String MAPPING_PREFIX
- See Also:
- Constant Field Values
-
WEBSITESALIAS
public static final String WEBSITESALIAS
- See Also:
- Constant Field Values
-
WEBSITESJOIN
public static final String WEBSITESJOIN
-
-
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.paging.SearchPageResponse<de.digitalcollections.model.identifiable.alias.LocalizedUrlAliases> find(de.digitalcollections.model.paging.SearchPageRequest searchPageRequest) throws UrlAliasRepositoryException- Specified by:
findin interfaceUrlAliasRepository- Throws:
UrlAliasRepositoryException
-
findAllForTarget
public de.digitalcollections.model.identifiable.alias.LocalizedUrlAliases findAllForTarget(UUID uuid) throws UrlAliasRepositoryException
- Specified by:
findAllForTargetin 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
-
findOne
public de.digitalcollections.model.identifiable.alias.UrlAlias findOne(UUID uuid) throws UrlAliasRepositoryException
- Specified by:
findOnein 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
-
getColumnName
protected 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
-
update
public de.digitalcollections.model.identifiable.alias.UrlAlias update(de.digitalcollections.model.identifiable.alias.UrlAlias urlAlias) throws UrlAliasRepositoryException- Specified by:
updatein interfaceUrlAliasRepository- Throws:
UrlAliasRepositoryException
-
-