Class DefaultTransactionService<P extends Transaction>
java.lang.Object
com.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService<P>
com.broadleafcommerce.data.tracking.core.service.BaseRsqlCrudEntityService<P>
com.broadleafcommerce.creditaccount.service.DefaultTransactionService<P>
- All Implemented Interfaces:
TransactionService<P>
,com.broadleafcommerce.data.tracking.core.service.CrudEntityService<P>
,com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityService<P>
public class DefaultTransactionService<P extends Transaction>
extends com.broadleafcommerce.data.tracking.core.service.BaseRsqlCrudEntityService<P>
implements TransactionService<P>
The default implementation for the
Transaction
.- Author:
- Dima Myroniuk (dmyroniuk)
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultTransactionService
(TransactionRepository<com.broadleafcommerce.data.tracking.core.Trackable> repository, com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityHelper helper) -
Method Summary
Modifier and TypeMethodDescriptionprotected TransactionRepository<com.broadleafcommerce.data.tracking.core.Trackable>
readCreditTransactionsWithAmountRemainingGreaterThenZero
(String creditAccountContextId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Reads the transactions by credit account id that have a remaining amount greater than zero, ordered by the expiration date.org.springframework.data.domain.Page<P>
readExpiredTransactions
(org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Reads the expired transactions with a remaining amount greater than zero.readExpiredTransactionsByCreditAccountId
(String creditAccountContextId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Reads the expired transactions by credit account id, with a remaining amount greater than zero.org.springframework.data.domain.Page<P>
readTransactionsByCreditAccountId
(String creditAccountContextId, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Reads the transactions for the specified credit account id.Methods inherited from class com.broadleafcommerce.data.tracking.core.service.BaseRsqlCrudEntityService
getRsqlHelper, readAll, readAll, readAll, readAll
Methods inherited from class com.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService
convertFromPersistentDomain, convertToPersistentDomain, create, createAll, createAllAllowingPartialSuccess, delete, getHelper, getSortPositionStrategy, readAll, readAll, readAll, readAllByContextId, readByContextId, replace, replaceAll, replaceAllAllowingPartialSuccess, setSortPositionStrategy, update, updateAll, updateAllAllowingPartialSuccess, updateSort
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.broadleafcommerce.data.tracking.core.service.CrudEntityService
create, createAll, createAllAllowingPartialSuccess, delete, readAll, readAll, readAll, readAllByContextId, readByContextId, replace, replaceAll, replaceAllAllowingPartialSuccess, update, updateAll, updateAllAllowingPartialSuccess, updateSort
Methods inherited from interface com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityService
readAll, readAll, readAll, readAll
-
Constructor Details
-
DefaultTransactionService
public DefaultTransactionService(TransactionRepository<com.broadleafcommerce.data.tracking.core.Trackable> repository, com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityHelper helper)
-
-
Method Details
-
readTransactionsByCreditAccountId
public org.springframework.data.domain.Page<P> readTransactionsByCreditAccountId(String creditAccountContextId, @Nullable org.springframework.data.domain.Pageable page, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:TransactionService
Reads the transactions for the specified credit account id.- Specified by:
readTransactionsByCreditAccountId
in interfaceTransactionService<P extends Transaction>
- Parameters:
creditAccountContextId
- the credit account context idpage
- the requested page of results from the databasecontextInfo
- context information related to multitenancy- Returns:
- the transactions for the specified credit account id.
-
readExpiredTransactions
public org.springframework.data.domain.Page<P> readExpiredTransactions(@Nullable org.springframework.data.domain.Pageable page, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:TransactionService
Reads the expired transactions with a remaining amount greater than zero.- Specified by:
readExpiredTransactions
in interfaceTransactionService<P extends Transaction>
- Parameters:
page
- the requested page of results from the databasecontextInfo
- context information related to multitenancy- Returns:
- the expired transactions with a remaining amount greater than zero.
-
readExpiredTransactionsByCreditAccountId
public List<P> readExpiredTransactionsByCreditAccountId(String creditAccountContextId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:TransactionService
Reads the expired transactions by credit account id, with a remaining amount greater than zero.- Specified by:
readExpiredTransactionsByCreditAccountId
in interfaceTransactionService<P extends Transaction>
- Parameters:
creditAccountContextId
- the credit account context idcontextInfo
- context information related to multitenancy- Returns:
- the expired transactions with a remaining amount greater than zero.
-
readCreditTransactionsWithAmountRemainingGreaterThenZero
public List<P> readCreditTransactionsWithAmountRemainingGreaterThenZero(String creditAccountContextId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:TransactionService
Reads the transactions by credit account id that have a remaining amount greater than zero, ordered by the expiration date.- Specified by:
readCreditTransactionsWithAmountRemainingGreaterThenZero
in interfaceTransactionService<P extends Transaction>
- Parameters:
creditAccountContextId
- the credit account context idcontextInfo
- context information related to multitenancy- Returns:
- the transactions that have the remaining amount greater than zero, ordered by the expiration date
-
getRepository
- Overrides:
getRepository
in classcom.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService<P extends Transaction>
-