org.axonframework.domain
Class DefaultIdentifierFactory
java.lang.Object
org.axonframework.domain.IdentifierFactory
org.axonframework.domain.DefaultIdentifierFactory
public class DefaultIdentifierFactory
- extends IdentifierFactory
Default IdentifierFactory implementation that uses generates random java.util.UUID
based identifiers.
Although the performance of this strategy is not the best out there, it has native supported on all JVMs.
This implementations selects a random identifier out of about 3 x 1038 possible values, making the chance
to get a duplicate incredibly small.
- Since:
- 1.2
- Author:
- Allard Buijze
Method Summary |
String |
generateIdentifier()
Generates a unique identifier for use by Entities (generally the Aggregate Root) and Events. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DefaultIdentifierFactory
public DefaultIdentifierFactory()
generateIdentifier
public String generateIdentifier()
- Generates a unique identifier for use by Entities (generally the Aggregate Root) and Events. The implementation
may choose whatever strategy it sees fit, as long as the chance of a duplicate identifier is acceptable to the
application.
This implementation creates identifiers based on pseudo-random UUIDs.
- Specified by:
generateIdentifier
in class IdentifierFactory
- Returns:
- a String representation of a unique identifier
Copyright © 2010-2016. All Rights Reserved.