Interface IdentifierGenerator

    • Method Detail

      • configure

        default void configure​(Type type,
                               Properties parameters,
                               ServiceRegistry serviceRegistry)
        Configure this instance, given the value of parameters specified by the user as <param> elements.

        This method is called just once, following instantiation, and before registerExportables(Database).

        Specified by:
        configure in interface Configurable
        type - The id property type descriptor
        parameters - param values, keyed by parameter name
        serviceRegistry - Access to service that may be needed.
        MappingException - If configuration fails.
      • initialize

        default void initialize​(SqlStringGenerationContext context)
        Initializes this instance, in particular pre-generates SQL as necessary.

        This method is called after registerExportables(Database), and before first use.

        context - A context to help generate SQL strings
      • generate

        Object generate​(SharedSessionContractImplementor session,
                        Object object)
        Generate a new identifier.
        session - The session from which the request originates
        object - the entity or collection (idbag) for which the id is being generated
        a new identifier
        HibernateException - Indicates trouble generating the identifier
      • generate

        default Object generate​(SharedSessionContractImplementor session,
                                Object owner,
                                Object currentValue,
                                EventType eventType)
        Generate a value.

        The currentValue is usually null for id generation.

        Specified by:
        generate in interface BeforeExecutionGenerator
        session - The session from which the request originates.
        owner - The instance of the object owning the attribute for which we are generating a value.
        currentValue - The current value assigned to the property, or null
        eventType - The type of event that has triggered generation of a new value
        The generated value
      • supportsJdbcBatchInserts

        default boolean supportsJdbcBatchInserts()
        this method is no longer called
        Check if JDBC batch inserts are supported.
        JDBC batch inserts are supported.