[hibernate-dev] OGM 5 Bootstrap: Reading property value in MetadataBuilderContributor
Gunnar Morling
gunnar at hibernate.org
Wed Apr 15 05:52:30 EDT 2015
Steve, all,
For migrating OGM to the new ORM 5 bootstrap APIs, I am looking into using
a MetadataBuilderContributor for applying an OGM-specific
ImplicitNamingStrategy.
Provided it is exposed via META-INF/services, the contributor is run
un-conditionally. So I'd need a way to find out whether the passed
MetadataBuilder is meant to bootstrap Hibernate ORM or OGM.
If there is no way to do so (I couldn't find any), could the previously
applied configuration settings be exposed e.g. via
* an accessor MetadataBuilder#getSettings()
* or a new parameter on
MetadataBuilderContributor#contribute(MetadataBuilder b, Map<String,
Object> settings)
* or even MetadataBuilderContributor#contribute(MetadataBuilder b,
StandardServiceRegistry ssr)
?
Then I could make contribute() instantly return depending on some property
which is set before (we can do that for JPA in HibernateOgmPersistence,
OGM's PersistenceProvider, and in a custom ServiceRegistry factory for
non-JPA).
Thanks,
--Gunnar
More information about the hibernate-dev
mailing list