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>
JPA implementation of
CustomizedDataFeedFileLobRepository
.-
Constructor Summary
ConstructorDescriptionJpaCustomizedDataFeedFileLobRepository
(JpaDataFeedQueryHelper queryHelper, com.broadleafcommerce.common.extension.TypeFactory typeFactory) -
Method Summary
Modifier and TypeMethodDescriptionprotected JpaDataFeedFileLobRepository<D>
Lazy injection so we can access base repository methods.protected javax.persistence.EntityManager
protected JpaDataFeedQueryHelper
protected com.broadleafcommerce.common.extension.TypeFactory
boolean
readToDestination
(String path, OutputStream destination) Despite this being a read method, it isTransactional
to keep the DB connection open after the initial entity fetch so that we can readJpaDataFeedFileLob.getContent()
.void
setBaseRepository
(JpaDataFeedFileLobRepository<D> baseRepository) Lazy injection so we can access base repository methods.boolean
store
(String path, InputStream content, long contentSizeInBytes, String tenantId) Stores a stream to a newJpaDataFeedFileLob
.
-
Constructor Details
-
JpaCustomizedDataFeedFileLobRepository
public JpaCustomizedDataFeedFileLobRepository(JpaDataFeedQueryHelper queryHelper, com.broadleafcommerce.common.extension.TypeFactory typeFactory)
-
-
Method Details
-
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 newJpaDataFeedFileLob
.- Specified by:
store
in interfaceCustomizedDataFeedFileLobRepository<D extends JpaDataFeedFileLob>
- Parameters:
path
- the value to use forJpaDataFeedFileLob.getPath()
content
- the data to store. This will always be closed by the implementation.contentSizeInBytes
- the size of thecontent
stream in bytestenantId
- 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 isTransactional
to keep the DB connection open after the initial entity fetch so that we can readJpaDataFeedFileLob.getContent()
.- Specified by:
readToDestination
in interfaceCustomizedDataFeedFileLobRepository<D extends JpaDataFeedFileLob>
- Parameters:
path
- the value to match forJpaDataFeedFileLob.getPath()
destination
- the destination to write the data to. This will always be closed by the implementation.- Returns:
- whether the operation was successful
-
getQueryHelper
-
getTypeFactory
protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory() -
getEntityManager
protected javax.persistence.EntityManager getEntityManager() -
getBaseRepository
Lazy injection so we can access base repository methods. -
setBaseRepository
Lazy injection so we can access base repository methods.
-