mardi 31 mars 2015

MongoDB Connection bean declearation

Anybody have an idea about what is the difference b/w :



<mongo:mongo host="localhost" port="27017"/> <mongo:db-factory id="mongoDbFactory" dbname="yourdb" />


and



<bean id="mongoTemplate" class="org.springframework.data.mongodb.core.MongoTemplate"> <constructor-arg name="mongo" ref="mongo" /> <constructor-arg name="databaseName" value="yourdb" /> </bean>
<bean id="mongo" class="org.springframework.data.mongodb.core.MongoFactoryBean"> <property name="host" value="localhost" /> </bean>

Aucun commentaire:

Enregistrer un commentaire