Class QueryUtil
java.lang.Object
com.broadleafcommerce.billing.provider.jpa.repository.QueryUtil
Utilities for working with JPA queries
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidoptimizeTransactionalBehavior(Runnable executor) If running in a transaction, set Hibernate's session flush mode toCOMMIT, and then reset toAUTOupon exit.<T> ToptimizeTransactionalBehavior(Supplier<T> supplier) If running in a transaction, set Hibernate's session flush mode toCOMMIT, and then reset toAUTOupon exit.
-
Constructor Details
-
QueryUtil
public QueryUtil()
-
-
Method Details
-
optimizeTransactionalBehavior
If running in a transaction, set Hibernate's session flush mode toCOMMIT, and then reset toAUTOupon exit. If it is known the logic in the flow will not be impacted by immediate stale reads after an update during the transaction, then this optimization can be added. Enabled by default where used. Can be disabled by setting thebroadleaf.billing.query.enable-transaction-query-read-optimizationproperty to false.- Type Parameters:
T- The type of the response object- Parameters:
supplier- The method logic to wrap in the optimized behavior- Returns:
- The wrapped method response
-
optimizeTransactionalBehavior
If running in a transaction, set Hibernate's session flush mode toCOMMIT, and then reset toAUTOupon exit. If it is known the logic in the flow will not be impacted by immediate stale reads after an update during the transaction, then this optimization can be added. Enabled by default where used. Can be disabled by setting thebroadleaf.billing.query.enable-transaction-query-read-optimizationproperty to false.- Parameters:
executor- The void method logic to wrap in the optimized behavior
-