[hibernate-dev] OpenJDK proposal: JDK 9 modules and reflection

Emmanuel Bernard emmanuel at hibernate.org
Tue Sep 13 04:19:31 EDT 2016

Hi all,

Sanne kindly pointed out to me the latest proposal by the OpenJDK team
around JDK 9 module and how they would handle frameworks needing access
to non exported types (Hibernate, dependency injection, etc).

If you are remotely into JDK9, please read it and provide feedback.

It's better than before for sure. It feels to me that most applications
(the core of it) will end up being a weak module for this to work
though. I'm not sure whether it is good or bad, at least a isolation
concious person has the choice.

    export private some.package;

Is essentially equivalent to what you can do for a given package in Java
What I am less clear about is what relation Hibernate * projects really
need with a module containing the entities. Do we still this proposal
still mandates to use

    requires hibernate.entitymanager;
    requires hibernate.core;

in the targeted module?

Or would this be a usable module

    module foo.bar {
        exports private com.foo.bar.model;
        requires javax.jpa;
        // requires hibernate.entitymanager/core; no longer needed thanks to export private?

Mark proposes that in a container (EE or anything controlling module loading
really), the container adds dynamically the addExports to the relevant
framework. But that looks like a solution to limit exports private



More information about the hibernate-dev mailing list