final List<String> entityClasses = Lists.newLinkedList();
for (String entityPackage : checkNotNull(entityPackages)) {
@SuppressWarnings("unchecked")
final AnnotationScannerListener listener = new AnnotationScannerListener(Entity.class);
final PackageNamesScanner scanner = new PackageNamesScanner(new String[] { entityPackage });
logger.info("Scanning " + entityPackage + " for entity classes");
scanner.scan(listener);
for (Class<?> entityClass : listener.getAnnotatedClasses()) {
configuration.addAnnotatedClass(entityClass);
entityClasses.add(entityClass.getCanonicalName());
}
}