Class FileResourceMetadataRepositoryImpl<F extends de.digitalcollections.model.identifiable.resource.FileResource>
- 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.IdentifiableRepositoryImpl<F>
-
- de.digitalcollections.cudami.server.backend.impl.jdbi.identifiable.resource.FileResourceMetadataRepositoryImpl<F>
-
- All Implemented Interfaces:
IdentifiableRepository<F>,FileResourceMetadataRepository<F>
- Direct Known Subclasses:
ApplicationFileResourceRepositoryImpl,AudioFileResourceRepositoryImpl,ImageFileResourceRepositoryImpl,LinkedDataFileResourceRepositoryImpl,TextFileResourceRepositoryImpl,VideoFileResourceRepositoryImpl
@Repository public class FileResourceMetadataRepositoryImpl<F extends de.digitalcollections.model.identifiable.resource.FileResource> extends IdentifiableRepositoryImpl<F> implements FileResourceMetadataRepository<F>
-
-
Field Summary
Fields Modifier and Type Field Description static StringMAPPING_PREFIXstatic StringSQL_PREVIEW_IMAGE_FIELDS_PIstatic StringTABLE_ALIASstatic StringTABLE_NAME-
Fields inherited from class de.digitalcollections.cudami.server.backend.impl.jdbi.identifiable.IdentifiableRepositoryImpl
additionalReduceRowsBiFunction, basicReduceRowsBiFunction, fullReduceRowsBiFunction, identifiableImplClass, sqlSelectAllFields, sqlSelectAllFieldsJoins, sqlSelectReducedFields
-
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 Modifier Constructor Description FileResourceMetadataRepositoryImpl(org.jdbi.v3.core.Jdbi dbi, CudamiConfig cudamiConfig)protectedFileResourceMetadataRepositoryImpl(org.jdbi.v3.core.Jdbi dbi, String tableName, String tableAlias, String mappingPrefix, Class fileResourceImplClass, String sqlSelectAllFields, String sqlSelectReducedFields, String sqlInsertFields, String sqlInsertValues, String sqlUpdateFieldValues, int offsetForAlternativePaging)protectedFileResourceMetadataRepositoryImpl(org.jdbi.v3.core.Jdbi dbi, String tableName, String tableAlias, String mappingPrefix, String sqlSelectAllFields, String sqlSelectReducedFields, String sqlInsertFields, String sqlInsertValues, String sqlUpdateFieldValues, String sqlSelectAllFieldsJoins, BiFunction<Map<UUID,F>,org.jdbi.v3.core.result.RowView,Map<UUID,F>> additionalReduceRowsBiFunction, int offsetForAlternativePaging)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected List<String>getAllowedOrderByFields()StringgetColumnName(String modelProperty)protected List<String>getSearchTermTemplates(String tblAlias, String originalSearchTerm)static StringgetSqlInsertFields()static StringgetSqlInsertValues()static StringgetSqlSelectAllFields(String tableAlias, String mappingPrefix)static StringgetSqlSelectReducedFields(String tableAlias, String mappingPrefix)static StringgetSqlUpdateFieldValues()Fsave(F fileResource)protected booleansupportsCaseSensitivityForProperty(String modelProperty)Returns whether the passed property can be sorted case sensitive (in general).Fupdate(F fileResource)-
Methods inherited from class de.digitalcollections.cudami.server.backend.impl.jdbi.identifiable.IdentifiableRepositoryImpl
addCrossTablePageRequestParams, addRelatedEntity, addRelatedFileresource, addSearchTermMappings, delete, extendReducedIdentifiable, find, find, find, find, findByLanguageAndInitial, getAllFull, getAllReduced, getByIdentifier, getByUuidAndFiltering, getIndex, getIndex, getLanguages, getRelatedEntities, getRelatedFileResources, getSqlSelectAllFields, getSqlSelectReducedFields, getUniqueField, getWhereClause, retrieveCount, retrieveList, retrieveOne, retrieveOne, retrieveOne, save, setRelatedEntities, setRelatedFileResources, splitToArray, update
-
Methods inherited from class de.digitalcollections.cudami.server.backend.impl.jdbi.JdbiRepositoryImpl
addFiltering, addFiltering, addSearchTerm, count, count, escapeTermForJsonpath, getCommonSearchSql, getFilterClauses, getMappingPrefix, getTableAlias, getTableName, 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.resource.FileResourceMetadataRepository
createByMimeType
-
Methods inherited from interface de.digitalcollections.cudami.server.backend.api.repository.identifiable.IdentifiableRepository
addRelatedEntity, addRelatedEntity, addRelatedFileresource, addRelatedFileresource, count, delete, delete, find, find, findByLanguageAndInitial, getAllFull, getAllReduced, getByIdentifier, getByIdentifier, getByUuid, getByUuidAndFiltering, getLanguages, getRelatedEntities, getRelatedEntities, getRelatedFileResources, getRelatedFileResources, save, setRelatedEntities, setRelatedEntities, setRelatedFileResources, setRelatedFileResources, update
-
-
-
-
Field Detail
-
MAPPING_PREFIX
public static final String MAPPING_PREFIX
- See Also:
- Constant Field Values
-
SQL_PREVIEW_IMAGE_FIELDS_PI
public static final String SQL_PREVIEW_IMAGE_FIELDS_PI
- 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
-
-
Constructor Detail
-
FileResourceMetadataRepositoryImpl
@Autowired public FileResourceMetadataRepositoryImpl(org.jdbi.v3.core.Jdbi dbi, CudamiConfig cudamiConfig)
-
FileResourceMetadataRepositoryImpl
protected FileResourceMetadataRepositoryImpl(org.jdbi.v3.core.Jdbi dbi, String tableName, String tableAlias, String mappingPrefix, Class fileResourceImplClass, String sqlSelectAllFields, String sqlSelectReducedFields, String sqlInsertFields, String sqlInsertValues, String sqlUpdateFieldValues, int offsetForAlternativePaging)
-
FileResourceMetadataRepositoryImpl
protected FileResourceMetadataRepositoryImpl(org.jdbi.v3.core.Jdbi dbi, String tableName, String tableAlias, String mappingPrefix, String sqlSelectAllFields, String sqlSelectReducedFields, String sqlInsertFields, String sqlInsertValues, String sqlUpdateFieldValues, String sqlSelectAllFieldsJoins, BiFunction<Map<UUID,F>,org.jdbi.v3.core.result.RowView,Map<UUID,F>> additionalReduceRowsBiFunction, int offsetForAlternativePaging)
-
-
Method Detail
-
getSqlInsertFields
public static String getSqlInsertFields()
-
getSqlInsertValues
public static String getSqlInsertValues()
-
getSqlSelectAllFields
public static String getSqlSelectAllFields(String tableAlias, String mappingPrefix)
-
getSqlSelectReducedFields
public static String getSqlSelectReducedFields(String tableAlias, String mappingPrefix)
-
getSqlUpdateFieldValues
public static String getSqlUpdateFieldValues()
-
getAllowedOrderByFields
protected List<String> getAllowedOrderByFields()
- Overrides:
getAllowedOrderByFieldsin classIdentifiableRepositoryImpl<F extends de.digitalcollections.model.identifiable.resource.FileResource>- Returns:
- model properties names that are applicable for sorting, will be mapped to database column names using @see #getColumnName
-
getColumnName
public String getColumnName(String modelProperty)
- Overrides:
getColumnNamein classIdentifiableRepositoryImpl<F extends de.digitalcollections.model.identifiable.resource.FileResource>- 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)
-
getSearchTermTemplates
protected List<String> getSearchTermTemplates(String tblAlias, String originalSearchTerm)
- Overrides:
getSearchTermTemplatesin classIdentifiableRepositoryImpl<F extends de.digitalcollections.model.identifiable.resource.FileResource>
-
save
public F save(F fileResource)
- Specified by:
savein interfaceIdentifiableRepository<F extends de.digitalcollections.model.identifiable.resource.FileResource>
-
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().- Overrides:
supportsCaseSensitivityForPropertyin classIdentifiableRepositoryImpl<F extends de.digitalcollections.model.identifiable.resource.FileResource>- Parameters:
modelProperty- the property name (similar toAbstractPagingAndSortingRepositoryImpl.getColumnName(java.lang.String))- Returns:
trueonly if case (in)sensitive sorting is possible
-
update
public F update(F fileResource)
- Specified by:
updatein interfaceIdentifiableRepository<F extends de.digitalcollections.model.identifiable.resource.FileResource>
-
-