DATADOC-300 Changing to use InvalidMongoDbApiUsageException
This commit is contained in:
@@ -21,7 +21,6 @@ import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
|
||||
import org.bson.types.BasicBSONList;
|
||||
import org.springframework.dao.InvalidDataAccessApiUsageException;
|
||||
import org.springframework.data.mongodb.InvalidMongoDbApiUsageException;
|
||||
import org.springframework.data.mongodb.core.geo.Circle;
|
||||
import org.springframework.data.mongodb.core.geo.Point;
|
||||
@@ -456,7 +455,7 @@ public class Criteria implements CriteriaDefinition {
|
||||
dbo.put(key, value);
|
||||
}
|
||||
else {
|
||||
throw new InvalidDataAccessApiUsageException("Due to limitations of the com.mongodb.BasicDBObject, " +
|
||||
throw new InvalidMongoDbApiUsageException("Due to limitations of the com.mongodb.BasicDBObject, " +
|
||||
"you can't add a second '" + key + "' expression specified as '" + key + " : " + value + "'. " +
|
||||
"Criteria already contains '" + key + " : " + existing + "'.");
|
||||
}
|
||||
|
||||
@@ -16,13 +16,12 @@
|
||||
package org.springframework.data.mongodb.core.query;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
|
||||
import com.mongodb.BasicDBObject;
|
||||
import com.mongodb.DBObject;
|
||||
import org.springframework.dao.InvalidDataAccessApiUsageException;
|
||||
import org.springframework.data.mongodb.InvalidMongoDbApiUsageException;
|
||||
|
||||
public class Query {
|
||||
|
||||
@@ -56,7 +55,7 @@ public class Query {
|
||||
this.criteria.put(key, criteria);
|
||||
}
|
||||
else {
|
||||
throw new InvalidDataAccessApiUsageException("Due to limitations of the com.mongodb.BasicDBObject, " +
|
||||
throw new InvalidMongoDbApiUsageException("Due to limitations of the com.mongodb.BasicDBObject, " +
|
||||
"you can't add a second '" + key + "' criteria. " +
|
||||
"Query already contains '" + existing.getCriteriaObject() + "'.");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user