use of dev.morphia.mapping.validation.MappingValidator in project morphia by mongodb.
the class Mapper method register.
/**
* @param entityModel the model to register
* @return the model
* @morphia.internal
* @since 2.3
*/
public EntityModel register(EntityModel entityModel) {
discriminatorLookup.addModel(entityModel);
mappedEntities.put(entityModel.getType(), entityModel);
if (entityModel.getCollectionName() != null) {
mappedEntitiesByCollection.computeIfAbsent(entityModel.getCollectionName(), s -> new CopyOnWriteArraySet<>()).add(entityModel);
}
if (!entityModel.isInterface()) {
new MappingValidator().validate(this, entityModel);
}
return entityModel;
}
Aggregations