Interface IdentifierGenerator

    • Method Detail

      • configure

        default void configure​(Type type,
                               java.util.Properties params,
                               ServiceRegistry serviceRegistry)
                        throws MappingException
        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
        Parameters:
        type - The id property type descriptor
        params - param values, keyed by parameter name
        serviceRegistry - Access to service that may be needed.
        Throws:
        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), before first use.

        Parameters:
        context - A context to help generate SQL strings
      • generate

        java.io.Serializable generate​(SharedSessionContractImplementor session,
                                      java.lang.Object object)
                               throws HibernateException
        Generate a new identifier.
        Parameters:
        session - The session from which the request originates
        object - the entity or collection (idbag) for which the id is being generated
        Returns:
        a new identifier
        Throws:
        HibernateException - Indicates trouble generating the identifier
      • supportsJdbcBatchInserts

        default boolean supportsJdbcBatchInserts()
        Check if JDBC batch inserts are supported.
        Returns:
        JDBC batch inserts are supported.