Class UUIDHexGenerator

  • All Implemented Interfaces:
    Configurable, IdentifierGenerator

    public class UUIDHexGenerator
    extends AbstractUUIDGenerator
    implements Configurable

    A UUIDGenerator that returns a string of length 32, This string will consist of only hex digits. Optionally, the string may be generated with separators between each component of the UUID.

    Mapping parameters supported: separator.

    • Constructor Detail

      • UUIDHexGenerator

        public UUIDHexGenerator()
    • Method Detail

      • configure

        public void configure​(Type type,
                              java.util.Properties params,
                              ServiceRegistry serviceRegistry)
                       throws MappingException
        Description copied from interface: Configurable
        Configure this instance, given the value of parameters specified by the user as <param> elements. This method is called just once, following instantiation.
        Specified by:
        configure in interface Configurable
        type - The id property type descriptor
        params - param values, keyed by parameter name
        serviceRegistry - Access to service that may be needed.
      • generate

        public generate​(SharedSessionContractImplementor session,
                                             java.lang.Object obj)
        Description copied from interface: IdentifierGenerator
        Generate a new identifier.
        Specified by:
        generate in interface IdentifierGenerator
        session - The session from which the request originates
        obj - the entity or collection (idbag) for which the id is being generated
        a new identifier
      • format

        protected java.lang.String format​(int intValue)
      • format

        protected java.lang.String format​(short shortValue)