public class DefaultOrderHistoryService extends java.lang.Object implements OrderHistoryService
OrderHistoryService| Constructor and Description |
|---|
DefaultOrderHistoryService() |
| Modifier and Type | Method and Description |
|---|---|
OrderModel |
createHistorySnapshot(OrderModel currentVersion)
Creates a exact copy of the given order except that the copy will be marked as copy by setting
OrderModel.VERSIONID to true. |
protected java.util.Collection<java.lang.String> |
getEntriesDescriptions(java.util.Collection<OrderHistoryEntryModel> entries)
Fetches the collection of history entries descriptions
|
java.util.Collection<OrderHistoryEntryModel> |
getHistoryEntries(OrderModel ownerOrder,
java.util.Date dateFrom,
java.util.Date dateTo)
Fetches history entries of the ownerOrder from the given time range
|
protected java.util.Collection |
getHistoryEntries(OrderModel ownerOrder,
java.util.Date dateFrom,
java.util.Date dateTo,
boolean descriptionOnly)
Returns collection of
OrderHistoryEntryModel or OrderHistoryEntryModel.DESCRIPTION for a given
time range |
java.util.Collection<OrderHistoryEntryModel> |
getHistoryEntries(OrderModel ownerOrder,
EmployeeModel employee)
Fetches history entries of the ownerOrder from the given employee
|
java.util.Collection<OrderHistoryEntryModel> |
getHistoryEntries(UserModel user,
java.util.Date dateFrom,
java.util.Date dateTo)
Fetches history entries of the orders placed by the user in the given time range
|
java.util.Collection<java.lang.String> |
getHistoryEntriesDescriptions(OrderModel ownerOrder,
java.util.Date dateFrom,
java.util.Date dateTo)
Fetches the descriptions of history entries of the ownerOrder from the given time range
|
java.util.Collection<OrderModel> |
getHistorySnapshots(OrderModel ownerOrder)
Fetches all snapshots which have been created and assigned to the given order's history entries.
|
protected ModelService |
getModelService() |
KeyGenerator |
getVersionIDGenerator() |
protected boolean |
isWithingDateRange(OrderHistoryEntryModel entry,
java.util.Date from,
java.util.Date to) |
void |
saveHistorySnapshot(OrderModel snapshot)
Actually persists a previously created order snapshot.
|
void |
setModelService(ModelService modelService) |
void |
setVersionIDGenerator(KeyGenerator versionIDGenerator) |
public KeyGenerator getVersionIDGenerator()
public void setVersionIDGenerator(KeyGenerator versionIDGenerator)
public OrderModel createHistorySnapshot(OrderModel currentVersion)
OrderHistoryServiceOrderModel.VERSIONID to true.createHistorySnapshot in interface OrderHistoryServicecurrentVersion - the original order to be copied copypublic void saveHistorySnapshot(OrderModel snapshot)
OrderHistoryServiceModelService.save(Object) to
overcome Jalo layer business logic resetting some attributes. In future this may not be necessary.saveHistorySnapshot in interface OrderHistoryServicesnapshot - the order snapshotpublic java.util.Collection<OrderModel> getHistorySnapshots(OrderModel ownerOrder)
OrderHistoryServicegetHistorySnapshots in interface OrderHistoryServiceownerOrder - the original orderprotected java.util.Collection getHistoryEntries(OrderModel ownerOrder, java.util.Date dateFrom, java.util.Date dateTo, boolean descriptionOnly)
OrderHistoryEntryModel or OrderHistoryEntryModel.DESCRIPTION for a given
time rangeownerOrder - - requireddateFrom - - possible null valuedateTo - - possible null valuedescriptionOnly - - set to true to get descriptions only instead of the whole OrderHistoryEntryModel objectsprotected boolean isWithingDateRange(OrderHistoryEntryModel entry, java.util.Date from, java.util.Date to)
public java.util.Collection<OrderHistoryEntryModel> getHistoryEntries(OrderModel ownerOrder, EmployeeModel employee)
OrderHistoryServicegetHistoryEntries in interface OrderHistoryServiceownerOrder - the owner orderemployee - instance of EmployeeModel to get the history of orders forOrderHistoryEntryModelpublic java.util.Collection<OrderHistoryEntryModel> getHistoryEntries(UserModel user, java.util.Date dateFrom, java.util.Date dateTo)
OrderHistoryServicegetHistoryEntries in interface OrderHistoryServiceuser - user that placed the ordersdateFrom - set dateFrom to null if you want to make the time range only half limiteddateTo - set dateTo to null if you want to make the time range only half limitedOrderHistoryEntryModelprotected java.util.Collection<java.lang.String> getEntriesDescriptions(java.util.Collection<OrderHistoryEntryModel> entries)
entries - history entries that you want to fetch descriptions frompublic java.util.Collection<OrderHistoryEntryModel> getHistoryEntries(OrderModel ownerOrder, java.util.Date dateFrom, java.util.Date dateTo)
OrderHistoryServicegetHistoryEntries in interface OrderHistoryServiceownerOrder - the owner orderdateFrom - upper limit of the time rangedateTo - lower limit of the time rangepublic java.util.Collection<java.lang.String> getHistoryEntriesDescriptions(OrderModel ownerOrder, java.util.Date dateFrom, java.util.Date dateTo)
OrderHistoryServicegetHistoryEntriesDescriptions in interface OrderHistoryServiceownerOrder - the owner orderdateFrom - upper limit of the time rangedateTo - lower limit of the time rangeprotected ModelService getModelService()
public void setModelService(ModelService modelService)
Copyright © 2018 SAP SE. All Rights Reserved.