In JPA 1.0's persistence.xml, <exclude-unlisted-classes> defaulted to false (providers always scanned for entities). As of JPA 2.0, <exclude-unlisted-classes> was changed to default to true. However, Hibernate EntityManager does not honor this. See lines 219-221 of PersistenceXmlParser.java:
This has two consequences:
If you omit <exclude-unlisted-classes>, Hibernate will scan for entities, which is not compliant. Hibernate should default to the right value based on the JPA version.
If you intentionally add <exclude-unlisted-classes>false</exclude-unlisted-classes> to persistence.xml to enable scanning, Hibernate will disable scanning, which is downright incorrect.
This probably makes more sense:
I don't know where the imaginary isJpaGte20 variable would come from.