use of dev.morphia.annotations.AlsoLoad in project morphia by mongodb.
the class ConfigureProperties method processProperties.
@SuppressWarnings("rawtypes")
void processProperties(EntityModelBuilder modelBuilder, MapperOptions options) {
Iterator<PropertyModelBuilder> iterator = modelBuilder.propertyModels().iterator();
while (iterator.hasNext()) {
final PropertyModelBuilder builder = iterator.next();
final int modifiers = builder.modifiers();
if (isStatic(modifiers) || isTransient(builder)) {
iterator.remove();
} else {
Property property = builder.getAnnotation(Property.class);
if (property != null && !property.concreteClass().equals(Object.class)) {
TypeData typeData = builder.typeData().withType(property.concreteClass());
builder.typeData(typeData);
}
AlsoLoad alsoLoad = builder.getAnnotation(AlsoLoad.class);
if (alsoLoad != null) {
for (String name : alsoLoad.value()) {
builder.alternateName(name);
}
}
if (builder.getAnnotation(Id.class) != null) {
modelBuilder.idPropertyName(builder.name());
}
if (builder.getAnnotation(Version.class) != null) {
modelBuilder.versionPropertyName(builder.name());
}
buildProperty(options, builder);
}
}
}
Aggregations