Class PrefixablePersistentKeyGenerator
java.lang.Object
de.hybris.platform.servicelayer.keygenerator.impl.PersistentKeyGenerator
de.hybris.platform.chinesepaymentmock.services.PrefixablePersistentKeyGenerator
- All Implemented Interfaces:
KeyGenerator
This implementation is an adapter to the
NumberSeries functionality of the platform for getting unique
numbers in a series persisted via database. It provides several setter methods for configuration of the used number
series like the key of the series at database. After configuration you should call the PersistentKeyGenerator.init() method for
assuring that the series is created.- Since:
- 21.05
-
Nested Class Summary
Nested classes/interfaces inherited from class de.hybris.platform.servicelayer.keygenerator.impl.PersistentKeyGenerator
PersistentKeyGenerator.Type -
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class de.hybris.platform.servicelayer.keygenerator.impl.PersistentKeyGenerator
createSeriesAfterLookupError, generateFor, init, initializeKeyGenerator, lookup, reset, setDigits, setKey, setNumeric, setStart, setTemplate, setType
-
Constructor Details
-
PrefixablePersistentKeyGenerator
public PrefixablePersistentKeyGenerator()
-
-
Method Details
-
generate
Description copied from interface:KeyGeneratorGenerates a new unique key. If this method is called twice it will never return the same key twice (if key A is returned by first call and key B by second call, A does not equals B). A order of returned keys is not guaranteed (depends on implementation). After a call of theKeyGenerator.reset()method the generator is reseted so that a key can be returned which already was returned before callingKeyGenerator.reset().- Specified by:
generatein interfaceKeyGenerator- Overrides:
generatein classPersistentKeyGenerator- Returns:
- unique key
-
getPrefix
- Returns:
- the prefix
-
setPrefix
- Parameters:
prefix- the prefix to set
-