List<Class<?>> classeswithPersistenceUnits = classFinder.findAnnotatedClasses(PersistenceUnits.class);
// Class-level annotation(s)
List<PersistenceUnit> persistenceUnitList = new ArrayList<PersistenceUnit>();
for (Class cls : classeswithPersistenceUnits) {
PersistenceUnits persistenceUnits = (PersistenceUnits) cls.getAnnotation(PersistenceUnits.class);
if (persistenceUnits != null) {
persistenceUnitList.addAll(Arrays.asList(persistenceUnits.value()));
}
for (PersistenceUnit persistenceUnit : persistenceUnitList) {
addPersistenceUnit(annotatedApp, persistenceUnit, cls, null, null);
}
persistenceUnitList.clear();