[hibernate-dev] Extract some methods form AbtractEntityManagerImpl

Emmanuel Bernard emmanuel at hibernate.org
Wed Feb 26 07:37:43 EST 2014


I see a couple of options and a big fundamental question. All need feedback from the ORM gurus

I am not sure AbstractEntityManager is a SPI in the first place. Naively I’d say it should be an internal class. Anyone remembers why it’s an SPI?

1. If AbstractEntityMangerImpl becomes internal, it’s not too problematic to open up the methods you are looking for and make them public.
2. Alternatively, you can move the method implementations in a helper class (static method maybe) and put this code in an internal package, you can then share these methods.

I guess you can do this code change to both 4.3 and 5 and we will change the OGM code in the next released version.

But that leads to an interesting question. We have API, SPI and internals. we all agree on the definition of internals, we have our differences when it comes to API vs SPI. But what we do not have is
- a stable / tested contract between ORM and OGM / Search
- that is not supported for regular ORM users

Do you see this as doable and worthwhile? Maybe an annotation on the contract and some annotated tests would be enough?

On 14 Feb 2014, at 17:32, Davide D'Alto <davide at hibernate.org> wrote:

> Hi,
> in OGM I'm reusing some of the methods in AbstractEntityMangerImpl, the
> problem is that their scope is protected and I had to move OgmEntityManager
> from the original package to *org.hibernate.jpa.spi*
> 
> Is it possible to expose these methods in some way, so that I can move
> OgmEntityManager to the original package?
> 
> The methods are:
> - applySavedSettings(NamedQueryDefinition namedQueryDefinition, QueryImpl
> jpaQuery);
> - resultClassChecking(Class resultType, NamedSQLQueryDefinition
> namedQueryDefinition);
> - applyProperties(Query query); (this is private but I've copied and paste
> it from ORM to OGM)
> 
> Thanks,
> Davide
> _______________________________________________
> hibernate-dev mailing list
> hibernate-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/hibernate-dev




More information about the hibernate-dev mailing list