ValueInfo beanElementType = multiValuedProperty.getElementValue();
if (beanElementType instanceof BeanValueInfo) {
BeanValueInfo bvi = (BeanValueInfo)beanElementType;
//
OneToManyMapping mapping;
RelationshipType type = oneToManyAnn.type();
if (type == RelationshipType.HIERARCHIC) {
MappedBy mappedBy = propertyInfo.getAnnotation(MappedBy.class);
if (mappedBy != null) {
throw new IllegalStateException();
}
mapping = new OneToManyMapping(bvi.getTypeInfo(), RelationshipType.HIERARCHIC);
} else {
RelatedMappedBy mappedBy = propertyInfo.getAnnotation(RelatedMappedBy.class);
if (mappedBy == null) {
throw new IllegalStateException();
}