while (definedIn != Object.class) {
try {
field = definedIn.getDeclaredField(fieldName);
break;
} catch (SecurityException e) {
throw new InitializationException(
"Access denied for field with implicit collection", e);
} catch (NoSuchFieldException e) {
definedIn = definedIn.getSuperclass();
}
}
if (field == null) {
throw new InitializationException("No field \""
+ fieldName
+ "\" for implicit collection");
} else if (!Collection.class.isAssignableFrom(field.getType())) {
throw new InitializationException("Field \""
+ fieldName
+ "\" declares no collection");
}
ImplicitCollectionMapperForClass mapper = getOrCreateMapper(definedIn);
mapper.add(new ImplicitCollectionMappingImpl(fieldName, itemType, itemFieldName));