object PersistenceId

Source
PersistenceId.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. PersistenceId
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. val DefaultSeparator: String

    Default separator character used for concatenating a typeHint with entityId to construct unique persistenceId.

    Default separator character used for concatenating a typeHint with entityId to construct unique persistenceId. This must be same as in Lagom's scaladsl.PersistentEntity, for compatibility. No separator is used in Lagom's javadsl.PersistentEntity so for compatibility with that the "" separator must be used instead.

  2. def apply(entityTypeHint: String, entityId: String, separator: String): PersistenceId

    Constructs a PersistenceId from the given entityTypeHint and entityId by concatenating them with the separator.

    Constructs a PersistenceId from the given entityTypeHint and entityId by concatenating them with the separator.

    Cluster Sharding is often used together with EventSourcedBehavior for the entities. The PersistenceId of the EventSourcedBehavior can typically be constructed with:

    PersistenceId(entityContext.entityTypeKey.name, entityContext.entityId)

    That format of the PersistenceId is not mandatory and only provided as a convenience of a "standardized" format.

    The default separator | is used by the apply that doesn't take a separator parameter.

    The | separator is also used in Lagom's scaladsl.PersistentEntity but no separator is used in Lagom's javadsl.PersistentEntity. For compatibility with Lagom's javadsl.PersistentEntity you should use "" as the separator.

    Exceptions thrown

    IllegalArgumentException if the entityTypeHint or entityId contains separator

  3. def apply(entityTypeHint: String, entityId: String): PersistenceId

    Constructs a PersistenceId from the given entityTypeHint and entityId by concatenating them with | separator.

    Constructs a PersistenceId from the given entityTypeHint and entityId by concatenating them with | separator.

    Cluster Sharding is often used together with EventSourcedBehavior for the entities. The PersistenceId of the EventSourcedBehavior can typically be constructed with:

    PersistenceId(entityContext.entityTypeKey.name, entityContext.entityId)

    That format of the PersistenceId is not mandatory and only provided as a convenience of a "standardized" format.

    Another separator can be defined by using the apply that takes a separator parameter.

    The | separator is also used in Lagom's scaladsl.PersistentEntity but no separator is used in Lagom's javadsl.PersistentEntity. For compatibility with Lagom's javadsl.PersistentEntity you should use "" as the separator.

    Exceptions thrown

    IllegalArgumentException if the entityTypeHint or entityId contains |

  4. def concat(entityTypeHint: String, entityId: String, separator: String): String

    Constructs a persistence id String from the given entityTypeHint and entityId by concatenating them with the separator.

    Constructs a persistence id String from the given entityTypeHint and entityId by concatenating them with the separator.

    Exceptions thrown

    IllegalArgumentException if the entityTypeHint or entityId contains separator

  5. def concat(entityTypeHint: String, entityId: String): String

    Constructs a persistence id String from the given entityTypeHint and entityId by concatenating them with | separator.

    Constructs a persistence id String from the given entityTypeHint and entityId by concatenating them with | separator.

    Exceptions thrown

    IllegalArgumentException if the entityTypeHint or entityId contains |

  6. def extractEntityId(id: String): String

    Extract the entityId from a persistence id String with the default separator |.

    Extract the entityId from a persistence id String with the default separator |. If the separator | is not found it return the id.

  7. def extractEntityType(id: String): String

    Extract the entityTypeHint from a persistence id String with the default separator |.

    Extract the entityTypeHint from a persistence id String with the default separator |. If the separator | is not found it return the empty String ("").

  8. def of(entityTypeHint: String, entityId: String, separator: String): PersistenceId

    Constructs a PersistenceId from the given entityTypeHint and entityId by concatenating them with the separator.

    Constructs a PersistenceId from the given entityTypeHint and entityId by concatenating them with the separator.

    Cluster Sharding is often used together with EventSourcedBehavior for the entities. The PersistenceId of the EventSourcedBehavior can typically be constructed with:

    PersistenceId.of(entityContext.getEntityTypeKey().name(), entityContext.getEntityId())

    That format of the PersistenceId is not mandatory and only provided as a convenience of a "standardized" format.

    The default separator | is used by the apply that doesn't take a separator parameter.

    The | separator is also used in Lagom's scaladsl.PersistentEntity but no separator is used in Lagom's javadsl.PersistentEntity. For compatibility with Lagom's javadsl.PersistentEntity you should use "" as the separator.

    Exceptions thrown

    IllegalArgumentException if the entityTypeHint or entityId contains separator

  9. def of(entityTypeHint: String, entityId: String): PersistenceId

    Constructs a PersistenceId from the given entityTypeHint and entityId by concatenating them with | separator.

    Constructs a PersistenceId from the given entityTypeHint and entityId by concatenating them with | separator.

    Cluster Sharding is often used together with EventSourcedBehavior for the entities. The PersistenceId of the EventSourcedBehavior can typically be constructed with:

    PersistenceId.of(entityContext.getEntityTypeKey().name(), entityContext.getEntityId())

    That format of the PersistenceId is not mandatory and only provided as a convenience of a "standardized" format.

    Another separator can be defined by using the PersistenceId.of that takes a separator parameter.

    The | separator is also used in Lagom's scaladsl.PersistentEntity but no separator is used in Lagom's javadsl.PersistentEntity. For compatibility with Lagom's javadsl.PersistentEntity you should use "" as the separator.

    Exceptions thrown

    IllegalArgumentException if the entityTypeHint or entityId contains |

  10. def ofUniqueId(id: String): PersistenceId

    Constructs a PersistenceId with id as the full unique identifier.

  11. def unapply(persistenceId: PersistenceId): Option[(String, String)]