kcarlson/Kundera — comment on commit 7fae025747d0a6cf76bed5531fc3d4629a04a0d0
File:  line 0
By kcarlson:

If using two persistence units and only listing specific classes to be handled by the persistence unit (in persistence.xml) getMetamodel would just return the first metamodel object it found, even if that metamodel was incorrect.

This caused the "throw new PersistenceException("No entity found by the name: " + entityName);" to be executed in KunderaQuery::initEntityClass depending on the order of persistence units.