Class JpaCustomizedDataFeedFileLobRepository<D extends JpaDataFeedFileLob>

java.lang.Object
com.broadleafcommerce.datafeed.provider.jpa.repository.nontrackable.JpaCustomizedDataFeedFileLobRepository<D>
Type Parameters:
D - the persisted domain type
All Implemented Interfaces:
CustomizedDataFeedFileLobRepository<D>

public class JpaCustomizedDataFeedFileLobRepository<D extends JpaDataFeedFileLob> extends Object implements CustomizedDataFeedFileLobRepository<D>
  • Constructor Details

    • JpaCustomizedDataFeedFileLobRepository

      public JpaCustomizedDataFeedFileLobRepository(JpaDataFeedQueryHelper queryHelper, com.broadleafcommerce.common.extension.TypeFactory typeFactory)
  • Method Details

    • getDomainType

      public Class<D> getDomainType()
    • store

      @Policy(operationTypes=CREATE) @Transactional("datafeedTransactionManager") public boolean store(String path, InputStream content, long contentSizeInBytes, String tenantId)
      Description copied from interface: CustomizedDataFeedFileLobRepository
      Stores a stream to a new JpaDataFeedFileLob.
      Specified by:
      store in interface CustomizedDataFeedFileLobRepository<D extends JpaDataFeedFileLob>
      Parameters:
      path - the value to use for JpaDataFeedFileLob.getPath()
      content - the data to store. This will always be closed by the implementation.
      contentSizeInBytes - the size of the content stream in bytes
      tenantId - the tenant ID to store the file under
      Returns:
      whether the operation was successful
    • readToDestination

      @Policy(operationTypes=READ) @Transactional(readOnly=true, transactionManager="datafeedTransactionManager") public boolean readToDestination(String path, OutputStream destination)
      Despite this being a read method, it is Transactional to keep the DB connection open after the initial entity fetch so that we can read JpaDataFeedFileLob.getContent().
      Specified by:
      readToDestination in interface CustomizedDataFeedFileLobRepository<D extends JpaDataFeedFileLob>
      Parameters:
      path - the value to match for JpaDataFeedFileLob.getPath()
      destination - the destination to write the data to. This will always be closed by the implementation.
      Returns:
      whether the operation was successful
    • getQueryHelper

      protected JpaDataFeedQueryHelper getQueryHelper()
    • getTypeFactory

      protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory()
    • getEntityManager

      protected javax.persistence.EntityManager getEntityManager()
    • getBaseRepository

      protected JpaDataFeedFileLobRepository<D> getBaseRepository()
      Lazy injection so we can access base repository methods.
    • setBaseRepository

      @Autowired @Lazy public void setBaseRepository(JpaDataFeedFileLobRepository<D> baseRepository)
      Lazy injection so we can access base repository methods.