Class UniqueIdentifierGenerator

java.lang.Object
org.openremote.model.util.UniqueIdentifierGenerator

public class UniqueIdentifierGenerator extends Object
Generate a globally unique identifier value.

This is a Hibernate identifier generator as well: Assigns a random UUID if the persisted entity instance is of type IdentifiableEntity and if its IdentifiableEntity.getId() method returns null.

  • Field Details

    • randomGenerator

      protected static final com.fasterxml.uuid.impl.RandomBasedGenerator randomGenerator
    • nameGenerator

      protected static final com.fasterxml.uuid.impl.NameBasedGenerator nameGenerator
  • Constructor Details

    • UniqueIdentifierGenerator

      public UniqueIdentifierGenerator()
  • Method Details

    • generateId

      public static String generateId()
      Generates a random UUID value encoded as Base62, 22 characters long.
    • generateId

      public static String generateId(String name)
      Generates the same UUID value encoded as Base62, 22 characters long, if the name is the same.
    • generateId

      public static String generateId(byte[] bytes)
      Generates the same UUID value encoded as Base62, 22 characters long, if the bytes are the same.