Class IdentifierRepositoryImpl
- 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.IdentifierRepositoryImpl
-
- All Implemented Interfaces:
IdentifierRepository
@Repository public class IdentifierRepositoryImpl extends JdbiRepositoryImpl implements IdentifierRepository
-
-
Field Summary
Fields Modifier and Type Field Description static StringMAPPING_PREFIXstatic StringSQL_FULL_FIELDS_IDstatic StringSQL_INSERT_FIELDSstatic StringSQL_INSERT_VALUESstatic StringSQL_REDUCED_FIELDS_IDstatic StringTABLE_ALIASstatic StringTABLE_NAME-
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 IdentifierRepositoryImpl(org.jdbi.v3.core.Jdbi dbi, CudamiConfig cudamiConfig)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddelete(List<UUID> uuids)intdeleteByIdentifiable(UUID identifiableUuid)List<de.digitalcollections.model.identifiable.Identifier>findByIdentifiable(UUID uuidIdentifiable)protected List<String>getAllowedOrderByFields()de.digitalcollections.model.identifiable.IdentifiergetByUuid(UUID identifierUuid)StringgetColumnName(String modelProperty)protected StringgetUniqueField()de.digitalcollections.model.identifiable.Identifiersave(de.digitalcollections.model.identifiable.Identifier identifier)protected booleansupportsCaseSensitivityForProperty(String modelProperty)Returns whether the passed property can be sorted case sensitive (in general).-
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.IdentifierRepository
count, delete, deleteByIdentifiable
-
-
-
-
Field Detail
-
MAPPING_PREFIX
public static final String MAPPING_PREFIX
- See Also:
- Constant Field Values
-
SQL_INSERT_FIELDS
public static final String SQL_INSERT_FIELDS
- See Also:
- Constant Field Values
-
SQL_INSERT_VALUES
public static final String SQL_INSERT_VALUES
- See Also:
- Constant Field Values
-
TABLE_ALIAS
public static final String TABLE_ALIAS
- See Also:
- Constant Field Values
-
SQL_REDUCED_FIELDS_ID
public static final String SQL_REDUCED_FIELDS_ID
-
SQL_FULL_FIELDS_ID
public static final String SQL_FULL_FIELDS_ID
-
TABLE_NAME
public static final String TABLE_NAME
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
IdentifierRepositoryImpl
@Autowired public IdentifierRepositoryImpl(org.jdbi.v3.core.Jdbi dbi, CudamiConfig cudamiConfig)
-
-
Method Detail
-
delete
public void delete(List<UUID> uuids) throws RepositoryException
- Specified by:
deletein interfaceIdentifierRepository- Throws:
RepositoryException
-
deleteByIdentifiable
public int deleteByIdentifiable(UUID identifiableUuid) throws RepositoryException
- Specified by:
deleteByIdentifiablein interfaceIdentifierRepository- Throws:
RepositoryException
-
findByIdentifiable
public List<de.digitalcollections.model.identifiable.Identifier> findByIdentifiable(UUID uuidIdentifiable) throws RepositoryException
- Specified by:
findByIdentifiablein interfaceIdentifierRepository- Throws:
RepositoryException
-
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.Identifier getByUuid(UUID identifierUuid) throws RepositoryException
- Specified by:
getByUuidin interfaceIdentifierRepository- Throws:
RepositoryException
-
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
-
save
public de.digitalcollections.model.identifiable.Identifier save(de.digitalcollections.model.identifiable.Identifier identifier) throws RepositoryException- Specified by:
savein interfaceIdentifierRepository- Throws:
RepositoryException
-
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
-
-