DATADOC-88 changed db attribute to dbname on <mongo:db-factory>
This commit is contained in:
@@ -73,11 +73,11 @@ public class MongoDbFactoryParser extends AbstractBeanDefinitionParser {
|
||||
}
|
||||
|
||||
// Database name
|
||||
String db = element.getAttribute("db");
|
||||
if (!StringUtils.hasText(db)) {
|
||||
db = "db";
|
||||
String dbname = element.getAttribute("dbname");
|
||||
if (!StringUtils.hasText(dbname)) {
|
||||
dbname = "db";
|
||||
}
|
||||
dbFactoryBuilder.addPropertyValue("databaseName", db);
|
||||
dbFactoryBuilder.addPropertyValue("databaseName", dbname);
|
||||
|
||||
// Create or reference a MongoFactory instance.
|
||||
// Also respect embedded "mongo:mongo" definitions.
|
||||
|
||||
@@ -61,7 +61,7 @@ The name of the mongo definition (by default "mongoDbFactory").]]></xsd:document
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="db" type="xsd:string" use="optional">
|
||||
<xsd:attribute name="dbname" type="xsd:string" use="optional">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation><![CDATA[
|
||||
The name of the database to connect to. Default is 'db'.
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<bean id="mongoTemplate" class="org.springframework.data.document.mongodb.MongoTemplate">
|
||||
<constructor-arg>
|
||||
<mongo:db-factory db="database"/>
|
||||
<mongo:db-factory dbname="database"/>
|
||||
</constructor-arg>
|
||||
</bean>
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<context:property-placeholder
|
||||
location="classpath:/org/springframework/data/document/mongodb/config/mongo.properties"/>
|
||||
|
||||
<mongo:db-factory db="database">
|
||||
<mongo:db-factory dbname="database">
|
||||
<mongo:mongo host="${mongo.host}" port="${mongo.port}">
|
||||
<mongo:options
|
||||
connectionsPerHost="${mongo.connectionsPerHost}"
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
|
||||
http://www.springframework.org/schema/data/mongo http://www.springframework.org/schema/data/mongo/spring-mongo-1.0.xsd">
|
||||
|
||||
<mongo:db-factory db="repositories"/>
|
||||
<mongo:db-factory dbname="repositories"/>
|
||||
<mongo:mapping-converter base-package="org.springframework.data.document.mongodb.repository"/>
|
||||
|
||||
<bean id="mongoTemplate" class="org.springframework.data.document.mongodb.MongoTemplate">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
|
||||
http://www.springframework.org/schema/data/repository http://www.springframework.org/schema/data/repository/spring-repository-1.0.xsd">
|
||||
|
||||
<mongo:db-factory db="repositories"/>
|
||||
<mongo:db-factory dbname="repositories"/>
|
||||
|
||||
<bean id="mongoTemplate" class="org.springframework.data.document.mongodb.MongoTemplate">
|
||||
<constructor-arg name="mongoDbFactory" ref="mongoDbFactory"/>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<bean class="org.springframework.data.document.mongodb.TestMongoConfiguration"/>
|
||||
|
||||
<mongo:db-factory db="database"/>
|
||||
<mongo:db-factory dbname="database"/>
|
||||
|
||||
<bean id="mappingConverter1" class="org.springframework.data.document.mongodb.convert.MappingMongoConverter">
|
||||
<constructor-arg ref="mappingContext" />
|
||||
|
||||
Reference in New Issue
Block a user