Steve and I are having a discussion around the intended behavior of
See also HHH-9665 and the corresponding pull request .
At the moment the implementation in EntityManagerFactoryImpl allows to unwrap into the
class itself. This way the user gets a reference to an internal class. IMO there should be
public interface which the user can unwrap to, eg HibernateEntityManagerFactory. This
additional methods we want to expose on top of the HibernateEntityManagerFactory. The
should be disallowed (by expception) in this case. IMO this is just a continuation of the
idea of splitting packages between public, spi and internal. Of course this cannot stop a
doing an explicit cast, but that's a different story imo.
Steve and I have different take on this issue, so we where wondering what others think?