We're updating the issue view to help you get more done. 

ManyToOneType#scheduleBatchLoadIfNeeded creates EntityKey instances even if absolutely not necessary

Description

ManyToOneType#scheduleBatchLoadIfNeeded creates EntityKey and then checks whether the entity is batch loadable. By far the most common case is that the entity will not be batch loadable, and that info is available from the persister directly (in fact the EntityKey method simply delegates to the persister method).

Also, org.hibernate.engine.spi.EntityKey#isBatchLoadable ought to be removed and calls adjusted to use org.hibernate.persister.entity.EntityPersister#isBatchLoadable instead.

Environment

None

Status

Assignee

Steve Ebersole

Reporter

Steve Ebersole

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Priority

Major