use of org.mongodb.morphia.mapping.MappingException in project morphia by mongodb.
the class DatastoreImpl method createRef.
@Override
public <T> DBRef createRef(final T entity) {
final T wrapped = ProxyHelper.unwrap(entity);
final Object id = mapper.getId(wrapped);
if (id == null) {
throw new MappingException("Could not get id for " + wrapped.getClass().getName());
}
return createRef(wrapped.getClass(), id);
}
Aggregations