In JPA and other Java specs, there is a pattern emerging where one could unwrap 
some objects from a common API

interface EntityManager {
  T unwrap(Class<T> type);
}

We typically let a Session be extracted from an EntityManager

Session session = entityManager.unwrap(Session.class);

I wonder if we want do provide a possibility for third party Hibernate 
integrators to let some objects be unwrapped.

FullTextSession ftSession = session.unwrap(FullTextSession.class);
//the current approach is via some static helper method
//FullTextSession ftSession =  Search.getFullTextSession(session);

That would mean that the integration point between HSearch and Hibernate would 
have an unwrap method and Hibernate would delegate the unwrap calls to each 
integrator until a non null object is returned.

It's just a thought, WDYT?
_______________________________________________
hibernate-dev mailing list
hibernate-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/hibernate-dev

Reply via email to