[hibernate-dev] Discovering/configuring package-info
Christian Bauer
hibernate at christianbauer.name
Fri Mar 22 04:17:15 EDT 2013
Testing the latest scanner changes. Still trying to configure an explicit persistence unit, where only the listed annotated classes (and listed package-info) are included, everything else should be ignored.
The PackageInfoArchiveEntryHandler will always add package names to DeploymentResources if there is a package-info.java file in ANY scanned package.
This leads to problems further down in second pass, when trying to bind for example a @FetchProfiles annotation found in a package-info will fail as the referenced persistent class can't be found.
The solution seems to be to ignore the archive entry in PackageInfoArchiveEntryHandler when ScanOptions#detectClasses is false. If I don't want annotated classes to be detected, I probably don't want annotated package-info as well.
More information about the hibernate-dev
mailing list