- Integration (maven) of Spring Data Neo4j in Dynamic Web Project using Jersey and Tomcat
- ...
- <repository>
- <id>spring-milestone</id>
- <name>Spring Maven MILESTONE Repository</name>
- <url>http://maven.springframework.org/milestone</url>
- </repository>
- <dependency>
- <groupId>org.springframework.data</groupId>
- <artifactId>spring-data-neo4j</artifactId>
- <version>2.0.0.RELEASE</version>
- </dependency>
- ...
- ...
- @NodeEntity
- public class Category {
- @GraphId Long nodeId;
- String categoryType;
- public Category(String categoryType){
- this.categoryType = categoryType;
- }
- }
- ...
- @Autowired Neo4jTemplate template;
- @Test @Transactional
- public void toGraphDb() {
- template.save(new Category("mashineCategory"));
- }
- ...
- <display-name>ElisaSimulatorM4</display-name>
- <servlet>
- <servlet-name>Jersey REST Service</servlet-name>
- <servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
- <init-param>
- <param-name>com.sun.jersey.config.property.packages</param-name>
- <param-value>de.elisa.communication.webservice.restservice.implementation</param-value>
- </init-param>
- <load-on-startup>1</load-on-startup>
- </servlet>
- <servlet-mapping>
- <servlet-name>Jersey REST Service</servlet-name>
- <url-pattern>/rest/*</url-pattern>
- </servlet-mapping>
- ...
- <beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:context="http://www.springframework.org/schema/context"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:neo4j="http://www.springframework.org/schema/data/neo4j"
- xmlns:tx="http://www.springframework.org/schema/tx"
- xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
- http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
- http://www.springframework.org/schema/data/neo4j http://www.springframework.org/schema/data/neo4j/spring-neo4j-2.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">
- <context:spring-configured/>
- <context:annotation-config/>
- <neo4j:config storeDirectory="path/to/db"/>
- <neo4j:repositories base-package="org.example.repository"/>
- </beans>