Class FileResourceMetadataRepositoryImpl<F extends de.digitalcollections.model.api.identifiable.resource.FileResource>

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.api.identifiable.resource.FileResource>
extends IdentifiableRepositoryImpl<F>
implements FileResourceMetadataRepository<F>
  • Field Details

  • Constructor Details

    • FileResourceMetadataRepositoryImpl

      @Autowired public FileResourceMetadataRepositoryImpl​(org.jdbi.v3.core.Jdbi dbi, IdentifierRepository identifierRepository)
    • FileResourceMetadataRepositoryImpl

      protected FileResourceMetadataRepositoryImpl​(org.jdbi.v3.core.Jdbi dbi, IdentifierRepository identifierRepository, java.lang.String tableName, java.lang.String tableAlias, java.lang.String mappingPrefix, java.lang.Class fileResourceImplClass, java.lang.String sqlSelectAllFields, java.lang.String sqlSelectReducedFields, java.lang.String sqlInsertFields, java.lang.String sqlInsertValues, java.lang.String sqlUpdateFieldValues)
  • Method Details

    • getSqlInsertFields

      public static java.lang.String getSqlInsertFields()
    • getSqlInsertValues

      public static java.lang.String getSqlInsertValues()
    • getSqlSelectAllFields

      public static java.lang.String getSqlSelectAllFields​(java.lang.String tableAlias, java.lang.String mappingPrefix)
    • getSqlSelectReducedFields

      public static java.lang.String getSqlSelectReducedFields​(java.lang.String tableAlias, java.lang.String mappingPrefix)
    • getSqlUpdateFieldValues

      public static java.lang.String getSqlUpdateFieldValues()
    • find

      public de.digitalcollections.model.api.paging.SearchPageResponse<F> find​(de.digitalcollections.model.api.paging.SearchPageRequest searchPageRequest)
      Specified by:
      find in interface IdentifiableRepository<F extends de.digitalcollections.model.api.identifiable.resource.FileResource>
      Overrides:
      find in class IdentifiableRepositoryImpl<F extends de.digitalcollections.model.api.identifiable.resource.FileResource>
    • getAllowedOrderByFields

      protected java.util.List<java.lang.String> getAllowedOrderByFields()
      Overrides:
      getAllowedOrderByFields in class IdentifiableRepositoryImpl<F extends de.digitalcollections.model.api.identifiable.resource.FileResource>
      Returns:
      model properties names that are applicable for sorting, will be mapped to database column names using @see #getColumnName
    • getColumnName

      protected java.lang.String getColumnName​(java.lang.String modelProperty)
      Overrides:
      getColumnName in class IdentifiableRepositoryImpl<F extends de.digitalcollections.model.api.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)
    • getCommonFileResourceSearchSql

      public java.lang.String getCommonFileResourceSearchSql​(java.lang.String tableName, java.lang.String tableAlias)
    • save

      public F save​(F fileResource)
      Specified by:
      save in interface IdentifiableRepository<F extends de.digitalcollections.model.api.identifiable.resource.FileResource>
    • update

      public F update​(F fileResource)
      Specified by:
      update in interface IdentifiableRepository<F extends de.digitalcollections.model.api.identifiable.resource.FileResource>