List<Class<?>> classeswithPersistenceContexts = classFinder.findAnnotatedClasses(PersistenceContexts.class);
// Class-level annotation(s)
List<PersistenceContext> persistenceContextList = new ArrayList<PersistenceContext>();
for (Class cls : classeswithPersistenceContexts) {
PersistenceContexts persistenceContexts = (PersistenceContexts) cls.getAnnotation(PersistenceContexts.class);
if (persistenceContexts != null) {
persistenceContextList.addAll(Arrays.asList(persistenceContexts.value()));
}
for (PersistenceContext persistenceContext : persistenceContextList) {
addPersistenceContext(annotatedApp, persistenceContext, cls, null, null);
}
persistenceContextList.clear();