Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.1.4
-
Security Level: public (Regular issues)
-
None
-
Patch Available
Description
The set of managed persistence classes that are managed by a persistence unit is defined by using one or
more of the following:[41]
• One or more object/relational mapping XML files
• One or more jar files that will be searched for classes
• An explicit list of the classes
• The annotated managed persistence classes contained in the root of the persistence unit (unless
the exclude-unlisted-classes element is specified)
All classes must be on the classpath to ensure that entity managers from different persistence units that
map the same class will be accessing the same identical class.
This says that if exclude-unlisted-classes is specified as true, then only the classes listed in <class> elements must be used in the PU. If it is specified as false, then the annotated classes must be included. It's the only thing that exclude-unlisted-classes affects. It doesn't affect classes from other units, and if false it doesn't say that <class> must be ignored, which is what the following code does in PersistenceUnitBuilder.java:
if (excludeUnlistedClasses) { gbeanData.clearAttribute("jarFileUrls"); } else { gbeanData.clearAttribute("managedClassNames"); }
I removed the else block to leave:
if (excludeUnlistedClasses) { gbeanData.clearAttribute("jarFileUrls"); }
Without this Geronimo isn't JavaEE 5 compliant.