[hibernate-dev] API/SPI in 5.0

Steve Ebersole steve at hibernate.org
Thu Feb 6 09:10:19 EST 2014


On Thu, Feb 6, 2014 at 6:46 AM, Emmanuel Bernard <emmanuel at hibernate.org>wrote:

Configuration.getreflectionManager (optional)
>

We do not use commons-annotations anymore at all (yaay!).  If you need
access to this type of functionality, I have been thinking about passing
along access to the Jandex index we use.



> The properties are used to bootstrap Hibernate Search as we receive our
> properties form the Hibernate ORM configurations
>

Settings/configuration values are now available via either the
SessionFactory or the ConfigurationService (which just holds the settings
and exposes them in various type-safe ways).


>
> The class mappings is necessary for us as it offers the list of entities
> we need to look at. From them, we bootstrap with the subsection that are
> @Indexed entities.
>

"Mapping information" is MetadataImplementor.  Though tbh it sounds like
you really just want/need Jandex.


> We do that by associating a SF Observer and passing in the Configuration
> object and using the SF instance passed.
> This observer is initialized by the Integrator.
>

I am not understanding this part at all.  Integrator is called during the
process of creating a SessionFactory, so I would think that the
sessionFactoryCreated callback would be moot here.  And you already have a
hook for a sessionFactoryClosed callback in Integrator#disintegrate.  So
you'll need to explain this some more.

Regardless, if you really really really want to use a
SessionFactoryObserver then you'd just call
SessionFactoryImplementor#addObserver from your Integrator


More information about the hibernate-dev mailing list