org.springframework.data.mongodb.core.MongoExceptionTranslator Java Examples

The following examples show how to use org.springframework.data.mongodb.core.MongoExceptionTranslator. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: RoutingDBFactory.java    From HA-DB with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
/**
 * @param client
 * @param databaseName
 * @param mongoInstanceCreated
 * @since 1.7
 */
private RoutingDBFactory(MongoClient mongoClient, String databaseName, boolean mongoInstanceCreated) {

	Assert.notNull(mongoClient, "MongoClient must not be null!");
	Assert.hasText(databaseName, "Database name must not be empty!");
	Assert.isTrue(databaseName.matches("[\\w-]+"),
			"Database name must only contain letters, numbers, underscores and dashes!");

	this.mongoClient = mongoClient;
	this.databaseName = databaseName;
	this.mongoInstanceCreated = mongoInstanceCreated;
	this.exceptionTranslator = new MongoExceptionTranslator();
}
 
Example #2
Source File: MongoFactoryBean.java    From mongodb-orm with Apache License 2.0 4 votes vote down vote up
public MongoFactoryBean(MongoDataSource dataSource) {
  this(dataSource.getClient(), dataSource.getDatabase(), false, new MongoExceptionTranslator());
  this.dataSource = dataSource;
}
 
Example #3
Source File: MongoConfig.java    From spring4-sandbox with Apache License 2.0 4 votes vote down vote up
@Bean
public MongoExceptionTranslator exceptionTranslator() {
	return new MongoExceptionTranslator();
}
 
Example #4
Source File: MongoConfig.java    From spring4-sandbox with Apache License 2.0 4 votes vote down vote up
@Bean
public MongoExceptionTranslator exceptionTranslator() {
	return new MongoExceptionTranslator();
}
 
Example #5
Source File: MongoConfig.java    From spring4-sandbox with Apache License 2.0 4 votes vote down vote up
@Bean
public MongoExceptionTranslator exceptionTranslator() {
	return new MongoExceptionTranslator();
}
 
Example #6
Source File: MongoConfig.java    From spring4-sandbox with Apache License 2.0 4 votes vote down vote up
@Bean
public MongoExceptionTranslator exceptionTranslator() {
	return new MongoExceptionTranslator();
}
 
Example #7
Source File: MongoConfig.java    From spring4-sandbox with Apache License 2.0 4 votes vote down vote up
@Bean
public MongoExceptionTranslator exceptionTranslator() {
	return new MongoExceptionTranslator();
}
 
Example #8
Source File: MongoConfig.java    From spring4-sandbox with Apache License 2.0 4 votes vote down vote up
@Bean
public MongoExceptionTranslator exceptionTranslator() {
	return new MongoExceptionTranslator();
}
 
Example #9
Source File: MongoConfig.java    From spring4-sandbox with Apache License 2.0 4 votes vote down vote up
@Bean
public MongoExceptionTranslator exceptionTranslator() {
	return new MongoExceptionTranslator();
}
 
Example #10
Source File: MongoConfig.java    From spring4-sandbox with Apache License 2.0 4 votes vote down vote up
@Bean
public MongoExceptionTranslator exceptionTranslator() {
	return new MongoExceptionTranslator();
}