Merge https://github.com/nawroth/spring-data-graph into nawroth
This commit is contained in:
2
pom.xml
2
pom.xml
@@ -93,7 +93,7 @@
|
||||
<dist.name>Spring Data Graph</dist.name>
|
||||
<dist.key>DATAGRAPH</dist.key>
|
||||
<dist.version>${project.version}</dist.version>
|
||||
<dist.releaseType>milestone</dist.releaseType>
|
||||
<dist.releaseType>snapshot</dist.releaseType>
|
||||
<dist.finalName>${dist.id}-${dist.version}</dist.finalName>
|
||||
<dist.fileName>${dist.finalName}.zip</dist.fileName>
|
||||
<dist.filePath>target/${dist.fileName}</dist.filePath>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<chapter id="cross-store">
|
||||
<title>Cross-store persistence with a graph database</title>
|
||||
<para>The Spring Data Graph project support cross-store persistence which allows parts of the data mode to be stored in a traditional
|
||||
JPA datastore (RDBMS) and other parts of the data model (even partial entites, i.e. some properties or relationships) in the graph
|
||||
JPA datastore (RDBMS) and other parts of the data model (even partial entites, that is some properties or relationships) in a graph
|
||||
store.
|
||||
</para>
|
||||
<para>
|
||||
@@ -40,7 +40,7 @@
|
||||
<title>@NodeEntity(partial = "true")</title>
|
||||
<para>
|
||||
When annotating an entity with partial true, DATAGRAPH assumes that this is a cross-store entity. So it is only responsible for the fields
|
||||
annotated with SDGRPAH annotations. JPA should not take care of those fields (they should be annotated with @Transient). In this mode of
|
||||
annotated with DATAGRAPH annotations. JPA should not take care of these fields (they should be annotated with @Transient). In this mode of
|
||||
operation DATAGRAPH also handles the cross-store connection via the content of the JPA id field.
|
||||
</para>
|
||||
</section>
|
||||
@@ -48,7 +48,7 @@
|
||||
<title>@GraphProperty</title>
|
||||
<para>
|
||||
For common fields containing primitive or convertible values that wouldn't have to be annotated in exclusive DATAGRAPH operations this
|
||||
explicit declaration is necessary to be sure that they are intended to be stored in the graph. Those fields should then be made transient
|
||||
explicit declaration is necessary to be sure that they are intended to be stored in the graph. These fields should then be made transient
|
||||
so that JPA doesn't try to take care of them as well.
|
||||
</para>
|
||||
</section>
|
||||
@@ -120,16 +120,21 @@
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:datagraph="http://www.springframework.org/schema/data/graph"
|
||||
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/graph http://www.springframework.org/schema/data/graph/datagraph-1.0.xsd
|
||||
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/graph
|
||||
http://www.springframework.org/schema/data/graph/datagraph-1.0.xsd
|
||||
">
|
||||
|
||||
<context:annotation-config/>
|
||||
|
||||
<datagraph:config storeDirectory="target/config-test" entityManagerFactory="entityManagerFactory"/>
|
||||
<datagraph:config storeDirectory="target/config-test"
|
||||
entityManagerFactory="entityManagerFactory"/>
|
||||
|
||||
<bean class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean" id="entityManagerFactory">
|
||||
<bean class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"
|
||||
id="entityManagerFactory">
|
||||
<property name="dataSource" ref="dataSource"/>
|
||||
<property name="persistenceXmlLocation" value="classpath:META-INF/persistence.xml"/>
|
||||
</bean>
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
<para>As explained in <xref linkend="why-sd-graph"/>, Spring Data Graph (DATAGRAPH) provides integration
|
||||
between the Spring framework and graph databases. Familiarity with the Spring framework is assumed as stated in <xref linkend="introduction"/>, and only
|
||||
minimally cross-referenced here. Graph databases and Neo4j in particular are explained in a bit more detail.
|
||||
minimally cross-referenced here. Graph databases and Neo4j in particular are explained in a bit more detail.
|
||||
The main focus of this document is however on explaining the steps needed to get a DATAGRAPH-backed application up and running.
|
||||
</para>
|
||||
|
||||
@@ -30,7 +29,7 @@
|
||||
such as the <ulink url="http://static.springframework.org/spring/docs/3.0.x/reference/beans.html">IoC</ulink> container,
|
||||
<ulink url="http://static.springsource.org/spring/docs/3.0.x/reference/validation.html#core-convert">converter</ulink> API and the
|
||||
<ulink url="http://static.springframework.org/spring/docs/3.0.x/reference/aop.html">AOP</ulink> infrastructure. While it is less important
|
||||
to know the Spring APIs, understanding the concepts behind them is.
|
||||
to know the Spring APIs, understanding the concepts behind them is essential.
|
||||
The Spring Framework documentation
|
||||
<ulink url="http://www.springsource.org/documentation">home page</ulink> is a good starting point for
|
||||
developers wanting become more familiar with Spring Framework.</para>
|
||||
@@ -69,11 +68,11 @@
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>IMDB sample</para>
|
||||
<para>A web application that imports datasets from the Internet Movie Database (IMDB) into the graph database. It allows listings of movies with their actors and actors with their roles in different movies. It also uses graph traversal operations to calculate the Kevin Bacon number (distance to a actor that has acted with Kevin Bacon). This sample application shows the basic usage of DATAGRAPH in a more complex setting with several annotated entities and relationships as well as usage of indices and graph traversal.</para>
|
||||
<para>A web application that imports datasets from the Internet Movie Database (IMDB) into the graph database. It allows listings of movies with their actors and actors with their roles in different movies. It also uses graph traversal operations to calculate the Kevin Bacon number (distance to an actor that has acted with Kevin Bacon). This sample application shows the basic usage of DATAGRAPH in a more complex setting with several annotated entities and relationships as well as usage of indices and graph traversal.</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>MyRestaurant sample</para>
|
||||
<para>Simple webapp for managing users and restaurants, with the ability to add a restaurants as favorites to a user.</para>
|
||||
<para>Simple webapp for managing users and restaurants, with the ability to add restaurants as favorites to a user.</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>MyRestaurant-Social sample</para>
|
||||
@@ -103,7 +102,7 @@
|
||||
</section>
|
||||
|
||||
<section id="get-started:up-to-date">
|
||||
<title>Following Development</title>
|
||||
<title>Follow the Development</title>
|
||||
|
||||
<para>For information on the Spring Data source code repository, nightly builds and snapshot artifacts please see the Spring Data home
|
||||
<ulink url="http://www.springsource.org/spring-data">page</ulink>.
|
||||
@@ -118,4 +117,4 @@
|
||||
(@<ulink url="http://twitter.com/SpringData">SpringData</ulink>)</para>
|
||||
</section>
|
||||
|
||||
</chapter>
|
||||
</chapter>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<para>
|
||||
Neo4j has been in commercial development for 10 years and in production for over 7 years. It is a mature and robust graph database that provides:
|
||||
<itemizedlist><listitem>
|
||||
an intuitive graph-oriented model for data representation. Instead of static and rigid tables, rows and columns, you work with a flexible graph network consisting of <ulink url="http://wiki.neo4j.org/content/Getting_Started_Guide">nodes, relationships and properties</ulink>.
|
||||
an intuitive graph-oriented model for data representation. Instead of static and rigid tables, rows and columns, you work with a flexible graph network consisting of <ulink url="http://wiki.neo4j.org/content/Getting_Started">nodes, relationships and properties</ulink>.
|
||||
</listitem><listitem> a disk-based, native storage manager completely optimized for storing graph structures for maximum performance and scalability.
|
||||
</listitem><listitem> massive scalability. Neo4j can handle graphs of several billion nodes/relationships/properties on a single machine and can be sharded to scale out across multiple machines.
|
||||
</listitem><listitem> a powerful traversal framework for high-speed traversals in the node space.
|
||||
@@ -30,11 +30,11 @@
|
||||
</para>
|
||||
<para>
|
||||
The EmbeddedGraphDatabaseService is running within the current Java application for highest performance and tightest integration. There are other,
|
||||
remote implementations that provide access to Neo4j stores via REST or RMI.</para>
|
||||
remote implementations that provide access to Neo4j stores via REST.</para>
|
||||
</section>
|
||||
<section>
|
||||
<title>Creating Nodes and Relationships</title>
|
||||
<para>Using the API of GraphDatabaseService it is easy to create nodes and relate them to each other. Relationships are named. Both nodes and relationships can have properties. Property values can be of primitive Java types and Strings as well as byte arrays for binary data.
|
||||
<para>Using the API of GraphDatabaseService it is easy to create nodes and relate them to each other. Relationships are named. Both nodes and relationships can have properties. Property values can be of primitive Java types and Strings as well as byte arrays for binary data or arrays of other Java primitives or Strings.
|
||||
Node creation and modification has to happen within a transaction, while reading from the graph store can be done without a transaction.
|
||||
<programlisting lang="JAVA" ><![CDATA[
|
||||
GraphDatabaseService graphDb = new EmbeddedGraphDatabase( "helloworld" );
|
||||
@@ -79,7 +79,7 @@ for ( Path position : traversalDescription.traverse( myStartNode )) {
|
||||
using Neo4j's index facilities. The GraphDatabaseService provides
|
||||
access to the IndexManager which in turn retrieves named indexes
|
||||
for nodes and relationships. Both can be indexed with property names
|
||||
and values. Retrieval happens via IndexHits which are an Iterator
|
||||
and values. Retrieval happens via IndexHits which is an Iterator
|
||||
over the results.
|
||||
|
||||
<programlisting lang="JAVA" ><![CDATA[
|
||||
@@ -90,9 +90,9 @@ for (Node foundNode = nodeIndex.get("property","value")) {
|
||||
assert node.getProperty("property").equals("value");
|
||||
}
|
||||
]]></programlisting>
|
||||
Currently indexing is a manual process; auto-indexes are a future
|
||||
feature. (DATAGRAPH already provides auto-indexing via the
|
||||
@Indexed annotation.)
|
||||
DATAGRAPH provides auto-indexing via the
|
||||
@Indexed annotation, while this still is a
|
||||
manual process when using the Neo4j API.
|
||||
</para>
|
||||
</section>
|
||||
</chapter>
|
||||
|
||||
@@ -12,6 +12,6 @@
|
||||
</para>
|
||||
<para>
|
||||
For the developer of a DATAGRAPH backed application only the public annotations are relevant, basic knowledge of graph stores is needed
|
||||
to access advanced functionality like traversals. Traversals results can also be mapped to fields of entities.
|
||||
to access advanced functionality like traversals. Traversal results can also be mapped to fields of entities.
|
||||
</para>
|
||||
</preface>
|
||||
|
||||
@@ -59,6 +59,7 @@ public class Role {
|
||||
private Actor actor;
|
||||
@EndNode
|
||||
private Movie movie;
|
||||
}
|
||||
]]></programlisting>
|
||||
</section>
|
||||
<section>
|
||||
@@ -71,10 +72,10 @@ public class Role {
|
||||
<title>Fields with @RelatedTo pointing to other NodeEntities</title>
|
||||
<para>
|
||||
Relationships to other NodeEntities are mapped to graph relationships. Those can either be single
|
||||
relationships (1:1) or multiple relationships (1:n). In most cases the simple relationships to other
|
||||
relationships (1:1) or multiple relationships (1:n). In most cases single relationships to other
|
||||
node entities don't have to be annotated as DATAGRAPH can extract all needed information from the field
|
||||
using reflection. In the case of
|
||||
multi-relationships, the <code>elementClass</code> parameter of @RelatedTo must be specified because of type erasure.
|
||||
multiple relationships, the <code>elementClass</code> parameter of @RelatedTo must be specified because of type erasure.
|
||||
The <code>direction</code> (default OUTGOING) and <code>type</code>
|
||||
(inferred from field name) parameters of the annotation are optional.
|
||||
</para>
|
||||
@@ -126,17 +127,17 @@ public class Actor {
|
||||
IndexManager,
|
||||
triggered by value modification.
|
||||
The resulting index can be used to later retrieve nodes or relationships that contain a certain property
|
||||
value (e.g. a name),
|
||||
often to establish the start node for a traversal.
|
||||
value (for example a name). Often an index is used to establish the start node for a traversal.
|
||||
Indexes are accessed by a Finder for a particular NodeEntity or RelationshipEntity, created via a FinderFactory.
|
||||
|
||||
</para>
|
||||
<para>
|
||||
GraphDatabaseContext exposes the
|
||||
indexes for Nodes and Relationships. Indexes can
|
||||
be named, for instance to keep separate domain concepts in separate indexes. That's why it is possible
|
||||
to specifiy an index name with
|
||||
the @Indexed annotation. It can also be specified at the entity level, this name is then the default
|
||||
index name for
|
||||
all fields of the entity. If no index name is specified, it defaults to the one configured with neo4j
|
||||
all fields of the entity. If no index name is specified, it defaults to the one configured with Neo4j
|
||||
("node" and "relationship").
|
||||
</para>
|
||||
</section>
|
||||
@@ -159,14 +160,14 @@ public class Actor {
|
||||
<title>Finding Nodes with Finders</title>
|
||||
<para>Spring Data Graph also comes with a type bound Repository-like
|
||||
Finder implementation that provides methods for locating nodes
|
||||
and relationships.
|
||||
and relationships:
|
||||
<itemizedlist>
|
||||
<listitem>using direct access <code>findById(id)</code> , </listitem>
|
||||
<listitem>iterating over all nodes of a node entity type (findAll), </listitem>
|
||||
<listitem>iterating over all nodes of a node entity type (findAll), </listitem>
|
||||
<listitem>counting the instances of a node entity type (count), </listitem>
|
||||
<listitem>iterating over all indexed instances with a certain property value (findAllByPropertyValue), </listitem>
|
||||
<listitem>getting a single instances with a certain property value (findByPropertyValue), </listitem>
|
||||
<listitem>iterating over a traversal result (findAllByTraversal), </listitem>
|
||||
<listitem>getting a single instance with a certain property value (findByPropertyValue), </listitem>
|
||||
<listitem>iterating over a traversal result (findAllByTraversal). </listitem>
|
||||
</itemizedlist>
|
||||
The Finder instances are created via a FinderFactory to be bound to a
|
||||
concrete node or relationship entity class.
|
||||
@@ -199,7 +200,7 @@ Iterable<Person> davesFriends = finder.findAllByTraversal(dave,
|
||||
</para>
|
||||
<para>
|
||||
An alternative approach could use indexing operations to perform the same functionality. Or one could skip the NodeTypeStrategy altogether if no
|
||||
strict checks on type conformity are needed that would allow for a much more flexible data model.
|
||||
strict checks on type conformity are needed, which would allow for a much more flexible data model.
|
||||
</para>
|
||||
</section>
|
||||
<section>
|
||||
@@ -212,9 +213,9 @@ Iterable<Person> davesFriends = finder.findAllByTraversal(dave,
|
||||
</para>
|
||||
<para>
|
||||
DATAGRAPH is designed to work within transaction boundaries. So entity creation and modification should happen within transactional methods.
|
||||
Due to the usage of POJO entities it is common to create and populate them also outside of a transaction (e.g. in the web layer). That's why
|
||||
Due to the usage of POJO entities it is common to create and populate them also outside of a transaction (for example in the web layer). That's why
|
||||
some housekeeping support was added to DATAGRAPH. It is possible to create node entities outside of transactions and also to modify their fields.
|
||||
Those values are then not stored within the backing node but instead only in the entity itself. When the entity reenters a transactional context
|
||||
The values are then not stored within the backing node but instead only in the entity itself. When the entity reenters a transactional context
|
||||
and its fields are read or written to, all the pending changes are flushed to the backing node first.
|
||||
</para>
|
||||
<para>At the moment there is no support for the creation of relationships outside of transactions and also more complex operations like creating whole
|
||||
@@ -225,7 +226,7 @@ Iterable<Person> davesFriends = finder.findAllByTraversal(dave,
|
||||
<title>Methods added to Entity Classes</title>
|
||||
<para>
|
||||
The node and relationship aspects introduce (via ITD - inter type declaration) several methods to the entities that
|
||||
make common tasks easier. Unfortunately those methods are not generified yet, so the
|
||||
make common tasks easier. Unfortunately these methods are not generified yet, so the
|
||||
results have to be casted to the correct return type.
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
@@ -241,7 +242,7 @@ Iterable<Person> davesFriends = finder.findAllByTraversal(dave,
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>equals and hashcode delegated to the underlying state</term>
|
||||
<term>equals and hashcode are delegated to the underlying state</term>
|
||||
<listitem>
|
||||
<para><code>entity.equals() and entity.hashCode()</code></para>
|
||||
</listitem>
|
||||
@@ -249,7 +250,7 @@ Iterable<Person> davesFriends = finder.findAllByTraversal(dave,
|
||||
<varlistentry>
|
||||
<term>creating relationships to a target node entity</term>
|
||||
<listitem>
|
||||
<para><code>nodeEntity.relateTo(targetEntity, relationshipClass, relationshipTyperelationshipType)</code></para>
|
||||
<para><code>nodeEntity.relateTo(targetEntity, relationshipClass, relationshipType)</code></para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
@@ -261,7 +262,7 @@ Iterable<Person> davesFriends = finder.findAllByTraversal(dave,
|
||||
<varlistentry>
|
||||
<term>removing a single relationship</term>
|
||||
<listitem>
|
||||
<para><code>nodeEntity.removeRelationshipTo(targetEntity, relationshipTyp)</code></para>
|
||||
<para><code>nodeEntity.removeRelationshipTo(targetEntity, relationshipType)</code></para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
@@ -294,7 +295,7 @@ Iterable<Person> davesFriends = finder.findAllByTraversal(dave,
|
||||
</para>
|
||||
<para>
|
||||
For instance an order can be used in these contexts: customer, procurement, logistics, billing, fulfillment and many more.
|
||||
Each of those contexts requires its distinct set of attributes and operations. As Java doesn't support Mixins one would put
|
||||
Each of those contexts requires its distinct set of attributes and operations. As Java doesn't support mixins one would put
|
||||
the sum of all of those into the entity class and thereby making it very big, brittle and hard to understand.
|
||||
Being able to take a basic order and project it to a different (not related in the inheritance hierarchy or even an interface)
|
||||
order type that is valid in the current context and only offers the attributes and methods needed here would be very benefitial.
|
||||
|
||||
@@ -3,19 +3,19 @@
|
||||
<chapter id="setup">
|
||||
<title>Setup required for Spring Data Graph</title>
|
||||
<para>To use DATAGRAPH in your application, some setup is required. For building the application the necessary Maven dependencies must be included and
|
||||
for the aspectj weaving some extensions of the compile goal are necessary. This chapter also discusses the Spring configuration needed to set up
|
||||
for the AspectJ weaving some extensions of the compile goal are necessary. This chapter also discusses the Spring configuration needed to set up
|
||||
DATAGRAPH. Examples for this setup can be found in the <ulink url="http://github.com/SpringSource/spring-data-graph-examples">DATAGRAPH examples</ulink>.
|
||||
</para>
|
||||
<section>
|
||||
<title>Maven Configuration</title>
|
||||
<para>
|
||||
As stated in the requirements chapter, DATAGRAPH projects are easiest to build with Apache Maven. The main dependencies are DATAGRAPH itself, Spring Data Commons, some parts of the Spring-Framework and of course the Neo4j graph database.
|
||||
As stated in the requirements chapter, DATAGRAPH projects are easiest to build with Apache Maven. The main dependencies are DATAGRAPH itself, Spring Data Commons, some parts of the Spring Framework and of course the Neo4j graph database.
|
||||
</para>
|
||||
<section>
|
||||
<title>Repositories</title>
|
||||
<para>
|
||||
The milestone releases of DATAGRAPH are available from the dedicated milestone repository. Neo4j
|
||||
releases are available from Maven Central, while snapshots are available from the Neo4j repository.
|
||||
releases and milestones are available from Maven Central.
|
||||
</para>
|
||||
<programlisting lang="XML"><![CDATA[
|
||||
<repository>
|
||||
@@ -23,12 +23,6 @@
|
||||
<name>Springframework Maven Repository</name>
|
||||
<url>http://maven.springframework.org/milestone</url>
|
||||
</repository>
|
||||
|
||||
<repository>
|
||||
<id>neo4j-public-repository</id>
|
||||
<name>Publically available Maven 2 repository for Neo4j</name>
|
||||
<url>http://m2.neo4j.org</url>
|
||||
</repository>
|
||||
]]></programlisting>
|
||||
</section>
|
||||
<section>
|
||||
@@ -46,9 +40,9 @@
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.aspectj</groupId>
|
||||
<artifactId>aspectjrt</artifactId>
|
||||
<version>1.6.10.RELEASE</version>
|
||||
<groupId>org.aspectj</groupId>
|
||||
<artifactId>aspectjrt</artifactId>
|
||||
<version>1.6.10.RELEASE</version>
|
||||
</dependency>
|
||||
]]></programlisting>
|
||||
|
||||
@@ -56,48 +50,48 @@
|
||||
<section>
|
||||
|
||||
<title>AspectJ build configuration</title>
|
||||
<para>As DATAGRAPH uses uses AspectJ for built time aspect weaving of your entities, it is necessary to add the aspectj-plugin to the build phases. The plugin has its own dependencies. You also need to explicitely specifiy libraries containing aspects (spring-aspects and spring-data-neo4j)</para>
|
||||
<para>As DATAGRAPH uses AspectJ for build time aspect weaving of your entities, it is necessary to add the aspectj-plugin to the build phases. The plugin has its own dependencies. You also need to explicitely specifiy libraries containing aspects (spring-aspects and spring-data-neo4j)</para>
|
||||
<programlisting lang="XML"><![CDATA[
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>aspectj-maven-plugin</artifactId>
|
||||
<version>1.0</version>
|
||||
<dependencies>
|
||||
<!-- NB: You must use Maven 2.0.9 or above or these are ignored (see MNG-2972) -->
|
||||
<dependency>
|
||||
<groupId>org.aspectj</groupId>
|
||||
<artifactId>aspectjrt</artifactId>
|
||||
<version>1.6.10.RELEASE</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.aspectj</groupId>
|
||||
<artifactId>aspectjtools</artifactId>
|
||||
<version>1.6.10.RELEASE</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>compile</goal>
|
||||
<goal>test-compile</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<outxml>true</outxml>
|
||||
<aspectLibraries>
|
||||
<aspectLibrary>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-aspects</artifactId>
|
||||
</aspectLibrary>
|
||||
<aspectLibrary>
|
||||
<groupId>org.springframework.data</groupId>
|
||||
<artifactId>spring-datastore-neo4j</artifactId>
|
||||
</aspectLibrary>
|
||||
</aspectLibraries>
|
||||
<source>1.6</source>
|
||||
<target>1.6</target>
|
||||
</configuration>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>aspectj-maven-plugin</artifactId>
|
||||
<version>1.0</version>
|
||||
<dependencies>
|
||||
<!-- NB: You must use Maven 2.0.9 or above or these are ignored (see MNG-2972) -->
|
||||
<dependency>
|
||||
<groupId>org.aspectj</groupId>
|
||||
<artifactId>aspectjrt</artifactId>
|
||||
<version>1.6.10.RELEASE</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.aspectj</groupId>
|
||||
<artifactId>aspectjtools</artifactId>
|
||||
<version>1.6.10.RELEASE</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>compile</goal>
|
||||
<goal>test-compile</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<outxml>true</outxml>
|
||||
<aspectLibraries>
|
||||
<aspectLibrary>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-aspects</artifactId>
|
||||
</aspectLibrary>
|
||||
<aspectLibrary>
|
||||
<groupId>org.springframework.data</groupId>
|
||||
<artifactId>spring-datastore-neo4j</artifactId>
|
||||
</aspectLibrary>
|
||||
</aspectLibraries>
|
||||
<source>1.6</source>
|
||||
<target>1.6</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
]]></programlisting>
|
||||
</section>
|
||||
@@ -142,14 +136,17 @@
|
||||
<programlisting lang="XML"><![CDATA[
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<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:context="http://www.springframework.org/schema/context"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:datagraph="http://www.springframework.org/schema/data/graph"
|
||||
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/graph http://www.springframework.org/schema/data/graph/datagraph-1.0.xsd
|
||||
">
|
||||
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/graph
|
||||
http://www.springframework.org/schema/data/graph/datagraph-1.0.xsd
|
||||
">
|
||||
|
||||
<context:annotation-config/>
|
||||
<datagraph:config storeDirectory="target/config-test"/>
|
||||
@@ -159,7 +156,8 @@
|
||||
<programlisting lang="XML"><![CDATA[
|
||||
<context:annotation-config/>
|
||||
|
||||
<bean id="graphDatabaseService" class="org.neo4j.kernel.EmbeddedGraphDatabase" destroy-method="shutdown">
|
||||
<bean id="graphDatabaseService" class="org.neo4j.kernel.EmbeddedGraphDatabase"
|
||||
destroy-method="shutdown">
|
||||
<constructor-arg index="0" value="target/config-test" />
|
||||
</bean>
|
||||
|
||||
@@ -167,11 +165,13 @@
|
||||
]]></programlisting>
|
||||
|
||||
<programlisting lang="XML"><![CDATA[
|
||||
<context:annotation-config/>
|
||||
<context:annotation-config/>
|
||||
|
||||
<datagraph:config storeDirectory="target/config-test" entityManagerFactory="entityManagerFactory"/>
|
||||
<datagraph:config storeDirectory="target/config-test"
|
||||
entityManagerFactory="entityManagerFactory"/>
|
||||
|
||||
<bean class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean" id="entityManagerFactory">
|
||||
<bean class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"
|
||||
id="entityManagerFactory">
|
||||
<property name="dataSource" ref="dataSource"/>
|
||||
<property name="persistenceXmlLocation" value="classpath:META-INF/persistence.xml"/>
|
||||
</bean>
|
||||
|
||||
Reference in New Issue
Block a user