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.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class -
Constructor Summary
ConstructorsConstructorDescriptionJpaCustomizedDataFeedFileLobRepository(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 jakarta.persistence.EntityManagerprotected JpaDataFeedQueryHelperprotected com.broadleafcommerce.common.extension.TypeFactorybooleanreadToDestination(String path, OutputStream destination) Despite this being a read method, it isTransactionalto keep the DB connection open after the initial entity fetch so that we can readJpaDataFeedFileLob.getContent().voidsetBaseRepository(JpaDataFeedFileLobRepository<D> baseRepository) Lazy injection so we can access base repository methods.booleanstore(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:CustomizedDataFeedFileLobRepositoryStores a stream to a newJpaDataFeedFileLob.- Specified by:
storein 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 thecontentstream 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 isTransactionalto keep the DB connection open after the initial entity fetch so that we can readJpaDataFeedFileLob.getContent().- Specified by:
readToDestinationin 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 jakarta.persistence.EntityManager getEntityManager() -
getBaseRepository
Lazy injection so we can access base repository methods. -
setBaseRepository
Lazy injection so we can access base repository methods.
-