| Prior to the change in HHH-13060 Closed , I would have expected your code to register 2 entity mappings but with the same name and then later when you iterated the persistent-class instances, that iterator contained only 1 entry. I hope you can see why that behavior is wrong and why an exception is necessary here. This exception is meant to provide an early and informative explanation of failure rather than potentially delaying the fault at run-time when users are using your application. The persistent-class instances are stored and keyed by name because JPA says that entity-names must be unique and this exception simply echos the exact same requirement during bootstrap. You mention you don't need to build the SessionFactory, so are you able to build multiple MetadataSources where each one registers only one of your `mypojo` entities and you do whatever logic your code does? |