hibernate-orm icon indicating copy to clipboard operation
hibernate-orm copied to clipboard

HHH-15856 pollution mitigations

Open whitingjr opened this issue 2 years ago • 5 comments

Mitgations for Loadable, EntityPersister and EntityInitializer.

whitingjr avatar Jan 03 '23 23:01 whitingjr

Thanks for your pull request!

This pull request appears to follow the contribution rules.

› This message was automatically generated.

nitpick: finishing each commit description with a "." looks a bit odd :)

Sanne avatar Jan 09 '23 11:01 Sanne

A suggestion, this can be done in a simpler way:

  • https://github.com/hibernate/hibernate-orm/commit/fc6c2cbd05aabe47fd482cc8a2d8ea5089b00734

Sanne avatar Jan 09 '23 14:01 Sanne

Yes a good suggestion. What do you want to do here. I re-work the existing commits or use this commit you suggested ?

whitingjr avatar Jan 10 '23 10:01 whitingjr

I've rebased it, and then removed all the overrides you don't actually need to make it simpler.

And now that it's simpler and I can understand what you're doing, I see it's adding a couple of public methods directly on the public API :( not sure if that's a good idea.

@sebersole what do you think of adding the following two methods on the EntityPersister API ?

       default org.hibernate.persister.entity.Loadable asLoadable() {
		return null;
	}

	@Override
	default EntityPersister asEntityPersister() {
		return this;
	}

these are methods which are only needed for technical reasons as a workaround for a JDK performance issue. They aren't of interest to end users, so it bothers me a bit to have them there.

Sanne avatar Jan 10 '23 16:01 Sanne