server/java/renkan-web/src/main/webapp/WEB-INF/mongo-config.xml
changeset 316 242510015401
parent 87 6c810f746837
child 457 b38cf3d4cf1f
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/server/java/renkan-web/src/main/webapp/WEB-INF/mongo-config.xml	Mon Jul 21 14:48:01 2014 +0200
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+	xmlns:p="http://www.springframework.org/schema/p" 
+    xmlns:mongo="http://www.springframework.org/schema/data/mongo"
+    xmlns:context="http://www.springframework.org/schema/context"
+    xmlns:jpa="http://www.springframework.org/schema/data/jpa"
+	xsi:schemaLocation="
+	        http://www.springframework.org/schema/context
+            http://www.springframework.org/schema/context/spring-context.xsd
+	        http://www.springframework.org/schema/beans
+	   		http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
+   			http://www.springframework.org/schema/data/mongo
+    		http://www.springframework.org/schema/data/mongo/spring-mongo-1.2.xsd
+            http://www.springframework.org/schema/data/jpa
+            http://www.springframework.org/schema/data/jpa/spring-jpa-1.3.xsd">	
+	
+	<context:property-placeholder order="1000" ignore-unresolvable="true" ignore-resource-not-found="false" location="WEB-INF/renkan.properties"/>
+	<context:property-placeholder  order="1" ignore-unresolvable="true" ignore-resource-not-found="true" location="classpath:renkan_run.properties"/>
+	<!-- Default bean name is 'mongo' -->
+	<mongo:mongo host="${mongodb.host.name}" port="${mongodb.host.port}" />
+		
+	<!-- Offers convenience methods and automatic mapping between MongoDB JSON documents and your domain classes. -->
+  	<bean id="mongoTemplate" class="org.springframework.data.mongodb.core.MongoTemplate">
+  	    <constructor-arg ref="mongo"/>
+  		<constructor-arg value="${mongodb.db.name}"/>
+  		<property name="writeResultChecking" value="EXCEPTION"/>
+  	</bean>
+  	
+  	<mongo:repositories base-package="org.iri_research.renkan" factory-class="org.iri_research.renkan.repositories.RenkanRepositoryFactoryBean" />
+
+</beans>