*/
boolean isNamedResource = false;
isSingleton = true;
for (ClassLineageIterator cIT = new ClassLineageIterator(c); cIT.hasNext();) {
final Class<?> currentClass = cIT.next();
final NamedResource r = currentClass.getAnnotation(NamedResource.class);
if (r != null) {
isNamedResource = true;
isPrimary = r.isPrimary();
subpath = (r.subpath().isEmpty() ? defaultSubpath(c) : r.subpath());
for (Field f : currentClass.getDeclaredFields()) {
f.setAccessible(true);
if (f.getAnnotation(NamedResource.class) != null) {
resourceNamedFields.add(f);
}
if (f.getAnnotation(NamedResource.Key.class) != null) {
if (f.getType().isArray()) {
throw new IllegalArgumentException(c.getName() + "@NamedResource.ID");
}
keyField = f;
}
}
if (isSingleton) {
if ( ! r.collectionName().isEmpty()) {
throw new IllegalArgumentException(c.getName() + " @NamedResource isSingleton & collectionName");
}
owningCollectionName = null;
} else {
owningCollectionName = (r.collectionName().isEmpty() ? defaultCollectionName(c) : r.collectionName());
}
}
}