DATAGRAPH-713 - Add Support for Neo4j 2.2.3.
This commit is contained in:
5
pom.xml
5
pom.xml
@@ -42,6 +42,7 @@
|
||||
|
||||
<neo4j.spatial.version>0.13-neo4j-2.1.4</neo4j.spatial.version>
|
||||
<neo4j-cypher-dsl.version>2.0.1</neo4j-cypher-dsl.version>
|
||||
<bundlor.failOnWarnings>false</bundlor.failOnWarnings>
|
||||
</properties>
|
||||
|
||||
|
||||
@@ -55,7 +56,7 @@
|
||||
<profile>
|
||||
<id>neo22</id>
|
||||
<properties>
|
||||
<neo4j.version>2.2.0-RC01</neo4j.version>
|
||||
<neo4j.version>2.2.3</neo4j.version>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
@@ -68,7 +69,7 @@
|
||||
<dependency>
|
||||
<groupId>org.neo4j</groupId>
|
||||
<artifactId>neo4j-spatial</artifactId>
|
||||
<version>0.14-neo4j-2.2.0-M02</version>
|
||||
<version>0.14-neo4j-2.2.3</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<repositories>
|
||||
|
||||
@@ -51,11 +51,11 @@
|
||||
<version>3.3.2.BUILD-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<!--dependency>
|
||||
<groupId>org.springframework.data</groupId>
|
||||
<artifactId>spring-data-neo4j-tx</artifactId>
|
||||
<version>3.3.2.BUILD-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependency-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.data</groupId>
|
||||
<artifactId>spring-data-neo4j</artifactId>
|
||||
|
||||
@@ -4,17 +4,17 @@
|
||||
|
||||
<groupId>org.neo4j.examples</groupId>
|
||||
<artifactId>cineasts</artifactId>
|
||||
<version>3.2.1.RELEASE</version>
|
||||
<version>3.3.2.BUILD-SNAPSHOT</version>
|
||||
<packaging>war</packaging>
|
||||
|
||||
<name>Cineasts.net</name>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<spring.version>4.0.7.RELEASE</spring.version>
|
||||
<spring.version>4.0.9.RELEASE</spring.version>
|
||||
<slf4j.version>1.7.10</slf4j.version>
|
||||
<spring-data-neo4j.version>${project.version}</spring-data-neo4j.version>
|
||||
<neo4j.version>2.1.5</neo4j.version>
|
||||
<neo4j.version>2.1.7</neo4j.version>
|
||||
<jetty-args></jetty-args>
|
||||
</properties>
|
||||
|
||||
@@ -32,6 +32,21 @@
|
||||
</repositories>
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>neo22</id>
|
||||
<properties>
|
||||
<neo4j.version>2.2.3</neo4j.version>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.neo4j</groupId>
|
||||
<artifactId>neo4j-io</artifactId>
|
||||
<version>${neo4j.version}</version>
|
||||
<type>test-jar</type>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>rest</id>
|
||||
<properties>
|
||||
@@ -224,6 +239,12 @@
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.neo4j</groupId>
|
||||
<artifactId>neo4j</artifactId>
|
||||
<version>${neo4j.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
package org.neo4j.graphdb;
|
||||
|
||||
import java.io.PrintWriter;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface Result extends ResourceIterator<Map<String, Object>>
|
||||
{
|
||||
/**
|
||||
* The exact names used to represent each column in the result set.
|
||||
*
|
||||
* @return List of the column names.
|
||||
*/
|
||||
List<String> columns();
|
||||
|
||||
/**
|
||||
* Returns an iterator with the result objects from a single column of the result set. This method is best used for
|
||||
* single column results.
|
||||
*
|
||||
* <p><b>To ensure that any resources, including transactions bound to it, are properly closed, the iterator must
|
||||
* either be fully exhausted, or the {@link ResourceIterator#close() close()} method must be
|
||||
* called.</b></p>
|
||||
*
|
||||
* @param name exact name of the column, as it appeared in the original query
|
||||
* @param <T> desired type cast for the result objects
|
||||
* @return an iterator of the result objects, possibly empty
|
||||
* @throws ClassCastException when the result object can not be cast to the requested type
|
||||
* @throws NotFoundException when the column name does not appear in the original query
|
||||
*/
|
||||
<T> ResourceIterator<T> columnAs(String name);
|
||||
|
||||
/**
|
||||
* Denotes there being more rows available in this result. These rows must either be consumed, by invoking
|
||||
* {@link #next()}, or the result has to be {@link #close() closed}.
|
||||
*
|
||||
* @return {@code true} if there is more rows available in this result, {@code false} otherwise.
|
||||
*/
|
||||
boolean hasNext();
|
||||
|
||||
/**
|
||||
* Returns the next row in this result.
|
||||
*
|
||||
* @return the next row in this result.
|
||||
*/
|
||||
Map<String, Object> next();
|
||||
|
||||
/**
|
||||
* Closes the result, freeing up any resources held by the result.
|
||||
*
|
||||
* This is an idempotent operation, invoking it multiple times has the same effect as invoking it exactly once.
|
||||
* It is thus safe (and even encouraged, for style and simplicity) to invoke this method even after consuming all
|
||||
* rows in the result through the {@link #next() next-method}.
|
||||
*/
|
||||
void close();
|
||||
|
||||
/**
|
||||
* Provides a textual representation of the query result.
|
||||
* <p><b>
|
||||
* The execution result represented by this object will be consumed in its entirety after this method is called.
|
||||
* Calling any of the other iterating methods on it should not be expected to return any results.
|
||||
* </b></p>
|
||||
*
|
||||
* @return the execution result formatted as a string
|
||||
*/
|
||||
String resultAsString();
|
||||
|
||||
/**
|
||||
* Provides a textual representation of the query result to the provided {@link PrintWriter}.
|
||||
* <p><b>
|
||||
* The execution result represented by this object will be consumed in its entirety after this method is called.
|
||||
* Calling any of the other iterating methods on it should not be expected to return any results.
|
||||
* </b></p>
|
||||
* @param writer the {@link PrintWriter} to receive the textual representation of the query result.
|
||||
*/
|
||||
void writeAsStringTo(PrintWriter writer);
|
||||
|
||||
/** Removing rows from the result is not supported. */
|
||||
void remove();
|
||||
}
|
||||
@@ -22,26 +22,12 @@ package org.neo4j.rest.graphdb;
|
||||
import org.neo4j.graphdb.*;
|
||||
import org.neo4j.graphdb.event.KernelEventHandler;
|
||||
import org.neo4j.graphdb.event.TransactionEventHandler;
|
||||
import org.neo4j.kernel.GraphDatabaseAPI;
|
||||
import org.neo4j.kernel.IdGeneratorFactory;
|
||||
import org.neo4j.kernel.KernelData;
|
||||
import org.neo4j.kernel.TransactionBuilder;
|
||||
import org.neo4j.kernel.guard.Guard;
|
||||
import org.neo4j.kernel.impl.core.KernelPanicEventGenerator;
|
||||
import org.neo4j.kernel.impl.core.NodeManager;
|
||||
import org.neo4j.kernel.impl.nioneo.store.StoreId;
|
||||
import org.neo4j.kernel.impl.persistence.PersistenceSource;
|
||||
import org.neo4j.kernel.impl.transaction.LockManager;
|
||||
import org.neo4j.kernel.impl.transaction.XaDataSourceManager;
|
||||
import org.neo4j.kernel.impl.transaction.xaframework.TxIdGenerator;
|
||||
import org.neo4j.kernel.impl.util.StringLogger;
|
||||
import org.neo4j.kernel.info.DiagnosticsManager;
|
||||
import org.neo4j.rest.graphdb.transaction.NullTransaction;
|
||||
|
||||
import javax.transaction.TransactionManager;
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
|
||||
abstract class AbstractRemoteDatabase implements GraphDatabaseAPI {
|
||||
|
||||
abstract class AbstractRemoteDatabase implements GraphDatabaseService {
|
||||
public Transaction beginTx() {
|
||||
return new NullTransaction();
|
||||
}
|
||||
@@ -62,11 +48,8 @@ abstract class AbstractRemoteDatabase implements GraphDatabaseAPI {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public TransactionBuilder tx() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public abstract Result execute(String s, Map<String, Object> map);
|
||||
public abstract Result execute(String s);
|
||||
@Override
|
||||
public void shutdown() {
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ package org.neo4j.rest.graphdb;
|
||||
import org.neo4j.graphdb.*;
|
||||
import org.neo4j.graphdb.schema.Schema;
|
||||
import org.neo4j.graphdb.traversal.BidirectionalTraversalDescription;
|
||||
import org.neo4j.kernel.impl.nioneo.store.StoreId;
|
||||
import org.neo4j.helpers.collection.IteratorUtil;
|
||||
import org.neo4j.rest.graphdb.entity.RestNode;
|
||||
import org.neo4j.rest.graphdb.index.RestIndexManager;
|
||||
import org.neo4j.rest.graphdb.query.RestCypherTransactionManager;
|
||||
@@ -82,16 +82,11 @@ public class CypherRestGraphDatabase extends AbstractRemoteDatabase implements R
|
||||
public Relationship getRelationshipById( long id ) {
|
||||
return this.restAPI.getRelationshipById(id);
|
||||
}
|
||||
@Override
|
||||
|
||||
public String getStoreDir() {
|
||||
return restAPI.getBaseUri();
|
||||
}
|
||||
|
||||
@Override
|
||||
public StoreId storeId() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAvailable(long timeout) {
|
||||
return restAPI!=null;
|
||||
@@ -101,7 +96,6 @@ public class CypherRestGraphDatabase extends AbstractRemoteDatabase implements R
|
||||
return restAPI.getTxManager();
|
||||
}
|
||||
|
||||
@Override
|
||||
public DependencyResolver getDependencyResolver() {
|
||||
return new DependencyResolver.Adapter() {
|
||||
@Override
|
||||
@@ -148,6 +142,31 @@ public class CypherRestGraphDatabase extends AbstractRemoteDatabase implements R
|
||||
};
|
||||
}
|
||||
|
||||
public ResourceIterator<Node> findNodes(Label label, String property, Object value) {
|
||||
return findNodesByLabelAndProperty(label, property,value).iterator();
|
||||
}
|
||||
|
||||
public Node findNode(Label label, String property, Object value) {
|
||||
return IteratorUtil.single(findNodes(label,property,value));
|
||||
}
|
||||
|
||||
public ResourceIterator<Node> findNodes(Label label) {
|
||||
Iterable<RestNode> nodes = restAPI.getNodesByLabel(label.name());
|
||||
return new ResourceIterableWrapper<Node,RestNode>(nodes) {
|
||||
protected Node underlyingObjectToObject(RestNode node) {
|
||||
return node;
|
||||
}
|
||||
}.iterator();
|
||||
}
|
||||
|
||||
public Result execute(String s) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public Result execute(String s, Map<String, Object> map) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Schema schema() {
|
||||
throw new UnsupportedOperationException();
|
||||
|
||||
@@ -23,7 +23,7 @@ package org.neo4j.rest.graphdb;
|
||||
import org.neo4j.graphdb.*;
|
||||
import org.neo4j.graphdb.schema.Schema;
|
||||
import org.neo4j.graphdb.traversal.BidirectionalTraversalDescription;
|
||||
import org.neo4j.kernel.impl.nioneo.store.StoreId;
|
||||
import org.neo4j.helpers.collection.IteratorUtil;
|
||||
import org.neo4j.rest.graphdb.entity.RestNode;
|
||||
import org.neo4j.rest.graphdb.index.RestIndexManager;
|
||||
import org.neo4j.rest.graphdb.query.RestCypherQueryEngine;
|
||||
@@ -35,6 +35,7 @@ import org.neo4j.rest.graphdb.util.ResourceIterableWrapper;
|
||||
import javax.transaction.TransactionManager;
|
||||
import java.util.Collection;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @deprecated use CypherRestGraphDatabase instead
|
||||
@@ -87,16 +88,11 @@ public class RestGraphDatabase extends AbstractRemoteDatabase implements RestAPI
|
||||
public Relationship getRelationshipById( long id ) {
|
||||
return this.restAPI.getRelationshipById(id);
|
||||
}
|
||||
@Override
|
||||
|
||||
public String getStoreDir() {
|
||||
return restAPI.getBaseUri();
|
||||
}
|
||||
|
||||
@Override
|
||||
public StoreId storeId() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAvailable(long timeout) {
|
||||
return restAPI!=null;
|
||||
@@ -106,7 +102,6 @@ public class RestGraphDatabase extends AbstractRemoteDatabase implements RestAPI
|
||||
return new NullTransactionManager();
|
||||
}
|
||||
|
||||
@Override
|
||||
public DependencyResolver getDependencyResolver() {
|
||||
return new DependencyResolver.Adapter() {
|
||||
@Override
|
||||
@@ -144,6 +139,31 @@ public class RestGraphDatabase extends AbstractRemoteDatabase implements RestAPI
|
||||
};
|
||||
}
|
||||
|
||||
public ResourceIterator<Node> findNodes(Label label, String property, Object value) {
|
||||
return findNodesByLabelAndProperty(label, property,value).iterator();
|
||||
}
|
||||
|
||||
public Node findNode(Label label, String property, Object value) {
|
||||
return IteratorUtil.single(findNodes(label,property,value));
|
||||
}
|
||||
|
||||
public ResourceIterator<Node> findNodes(Label label) {
|
||||
Iterable<RestNode> nodes = restAPI.getNodesByLabel(label.name());
|
||||
return new ResourceIterableWrapper<Node,RestNode>(nodes) {
|
||||
protected Node underlyingObjectToObject(RestNode node) {
|
||||
return node;
|
||||
}
|
||||
}.iterator();
|
||||
}
|
||||
|
||||
public Result execute(String s) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public Result execute(String s, Map<String, Object> map) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Schema schema() {
|
||||
throw new UnsupportedOperationException();
|
||||
|
||||
@@ -39,6 +39,9 @@ public class NullTransaction implements Transaction {
|
||||
public void failure() {
|
||||
}
|
||||
|
||||
public void terminate() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Lock acquireWriteLock(PropertyContainer propertyContainer) {
|
||||
return null;
|
||||
|
||||
@@ -68,6 +68,10 @@ public class RemoteCypherTransaction implements Transaction {
|
||||
close();
|
||||
}
|
||||
|
||||
public void terminate() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
if (tx() != null && innerCounter.decrementAndGet() > 0) {
|
||||
|
||||
@@ -22,6 +22,7 @@ import org.neo4j.graphdb.GraphDatabaseService;
|
||||
import org.neo4j.kernel.GraphDatabaseAPI;
|
||||
import org.springframework.beans.factory.FactoryBean;
|
||||
import org.springframework.data.neo4j.core.GraphDatabase;
|
||||
import org.springframework.data.neo4j.support.Neo4jEmbeddedTransactionManager;
|
||||
import org.springframework.transaction.jta.JtaTransactionManager;
|
||||
import org.springframework.transaction.jta.UserTransactionAdapter;
|
||||
|
||||
@@ -70,7 +71,7 @@ public class JtaTransactionManagerFactoryBean implements FactoryBean<JtaTransact
|
||||
return createJtaTransactionManagerForOnePointSeven( gds );
|
||||
}
|
||||
|
||||
return createNullJtaTransactionManager();
|
||||
return createEmbeddedJtaTransactionManager(gds);
|
||||
}
|
||||
|
||||
private JtaTransactionManager createJtaTransactionManager(GraphDatabase gdb)
|
||||
@@ -89,6 +90,14 @@ public class JtaTransactionManagerFactoryBean implements FactoryBean<JtaTransact
|
||||
return new JtaTransactionManager( userTransaction, transactionManager );
|
||||
}
|
||||
|
||||
private JtaTransactionManager createEmbeddedJtaTransactionManager(GraphDatabaseService gds)
|
||||
{
|
||||
TransactionManager transactionManager = new Neo4jEmbeddedTransactionManager(gds);
|
||||
UserTransaction userTransaction = new UserTransactionAdapter( transactionManager );
|
||||
|
||||
return new JtaTransactionManager( userTransaction, transactionManager );
|
||||
}
|
||||
|
||||
private JtaTransactionManager createJtaTransactionManagerForOnePointSeven( GraphDatabaseService gds )
|
||||
{
|
||||
TransactionManager transactionManager = createTransactionManagerForOnePointSeven( gds );
|
||||
|
||||
@@ -116,4 +116,4 @@ public class GraphRepositoryFactory extends RepositoryFactorySupport {
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,6 @@ import org.neo4j.graphdb.ConstraintViolationException;
|
||||
import org.neo4j.graphdb.NotFoundException;
|
||||
import org.neo4j.graphdb.NotInTransactionException;
|
||||
import org.neo4j.graphdb.TransactionFailureException;
|
||||
import org.neo4j.index.impl.lucene.QueryNotPossibleException;
|
||||
import org.neo4j.kernel.DeadlockDetectedException;
|
||||
import org.neo4j.kernel.impl.locking.community.LockException;
|
||||
import org.neo4j.kernel.impl.transaction.IllegalResourceException;
|
||||
@@ -55,8 +54,6 @@ public class Neo4jExceptionTranslator implements PersistenceExceptionTranslator
|
||||
throw new InvalidDataAccessResourceUsageException(ire.getMessage(), ire);
|
||||
} catch(NotFoundException nfe) {
|
||||
throw new DataRetrievalFailureException(nfe.getMessage(), nfe);
|
||||
} catch(QueryNotPossibleException qnpe) {
|
||||
throw new ConcurrencyFailureException(qnpe.getMessage(),qnpe);
|
||||
} catch(DeadlockDetectedException dde) {
|
||||
throw new ConcurrencyFailureException(dde.getMessage(),dde);
|
||||
} catch(LockException le) {
|
||||
@@ -64,6 +61,8 @@ public class Neo4jExceptionTranslator implements PersistenceExceptionTranslator
|
||||
} catch(RuntimeException e) {
|
||||
if (e.getClass().getName().equals("org.neo4j.kernel.impl.core.ReadOnlyDbException"))
|
||||
throw new InvalidDataAccessResourceUsageException(e.getMessage(), e);
|
||||
if (e.getClass().getName().equals("org.neo4j.index.impl.lucene.QueryNotPossibleException"))
|
||||
throw new ConcurrencyFailureException(e.getMessage(), e);
|
||||
if (e.getClass().getName().equals("org.neo4j.kernel.impl.nioneo.store.StoreFailureException"))
|
||||
throw new DataAccessResourceFailureException(e.getMessage(), e);
|
||||
if (e.getClass().getName().equals("org.neo4j.kernel.impl.persistence.IdGenerationFailedException"))
|
||||
|
||||
@@ -20,7 +20,6 @@ import org.junit.Assert;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.neo4j.graphdb.GraphDatabaseService;
|
||||
import org.neo4j.kernel.AbstractGraphDatabase;
|
||||
import org.neo4j.kernel.EmbeddedGraphDatabase;
|
||||
import org.neo4j.kernel.GraphDatabaseAPI;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
@@ -42,6 +42,8 @@ import org.springframework.test.context.support.DependencyInjectionTestExecution
|
||||
import org.springframework.test.context.transaction.TransactionalTestExecutionListener;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Iterator;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@@ -97,7 +99,7 @@ public class NoIndexDerivedFinderTests {
|
||||
Transaction tx = gdb.beginTx();
|
||||
try {
|
||||
final ExecutionResult result = new ExecutionEngine(gdb).execute("start n=node:Test('name:*') return n");
|
||||
assertEquals(0,IteratorUtil.count(result));
|
||||
assertEquals(0,IteratorUtil.count((Iterable)result));
|
||||
assertEquals("Test", gdb.index().nodeIndexNames()[0]);
|
||||
} finally {
|
||||
tx.success();tx.close();
|
||||
|
||||
@@ -17,12 +17,12 @@ package org.springframework.data.neo4j.repository;
|
||||
|
||||
import org.junit.Ignore;
|
||||
import org.neo4j.graphdb.Transaction;
|
||||
import org.neo4j.kernel.impl.util.FileUtils;
|
||||
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||
import org.springframework.dao.DataRetrievalFailureException;
|
||||
import org.springframework.data.neo4j.model.Car;
|
||||
import org.springframework.data.neo4j.model.Volvo;
|
||||
import org.springframework.data.neo4j.support.Neo4jTemplate;
|
||||
import org.springframework.util.FileSystemUtils;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
@@ -54,7 +54,7 @@ public class ReadWriteTests {
|
||||
} finally {
|
||||
ctx.close();
|
||||
if (delete) {
|
||||
FileUtils.deleteRecursively(new File("target/read-write.db"));
|
||||
FileSystemUtils.deleteRecursively(new File("target/read-write.db"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,9 +25,9 @@ import org.neo4j.kernel.GraphDatabaseAPI;
|
||||
import org.neo4j.graphdb.index.Index;
|
||||
import org.neo4j.graphdb.traversal.TraversalDescription;
|
||||
import org.neo4j.kernel.Traversal;
|
||||
import org.neo4j.kernel.impl.transaction.SpringTransactionManager;
|
||||
import org.neo4j.test.TestGraphDatabaseFactory;
|
||||
import org.springframework.dao.DataAccessException;
|
||||
import org.springframework.data.neo4j.config.JtaTransactionManagerFactoryBean;
|
||||
import org.springframework.data.neo4j.conversion.ResultConverter;
|
||||
import org.springframework.data.neo4j.core.GraphDatabase;
|
||||
import org.springframework.data.neo4j.support.DelegatingGraphDatabase;
|
||||
@@ -83,7 +83,7 @@ public class Neo4jTemplateApiTests {
|
||||
}
|
||||
|
||||
protected PlatformTransactionManager createTransactionManager() {
|
||||
return new JtaTransactionManager(new SpringTransactionManager((GraphDatabaseAPI)graphDatabaseService));
|
||||
return new JtaTransactionManagerFactoryBean(graphDatabaseService).getObject();
|
||||
}
|
||||
|
||||
private void createData() {
|
||||
|
||||
@@ -19,9 +19,9 @@ package org.springframework.data.neo4j.template;
|
||||
import org.junit.*;
|
||||
import org.neo4j.graphdb.*;
|
||||
import org.neo4j.kernel.GraphDatabaseAPI;
|
||||
import org.neo4j.kernel.impl.transaction.SpringTransactionManager;
|
||||
import org.neo4j.test.TestGraphDatabaseFactory;
|
||||
import org.springframework.dao.DataAccessException;
|
||||
import org.springframework.data.neo4j.config.JtaTransactionManagerFactoryBean;
|
||||
import org.springframework.data.neo4j.core.GraphDatabase;
|
||||
import org.springframework.data.neo4j.model.Person;
|
||||
import org.springframework.data.neo4j.support.DelegatingGraphDatabase;
|
||||
@@ -102,7 +102,7 @@ public class Neo4jTemplateApiTransactionTests {
|
||||
}
|
||||
|
||||
protected PlatformTransactionManager createTransactionManager() {
|
||||
return new JtaTransactionManager(new SpringTransactionManager((GraphDatabaseAPI)graphDatabaseService));
|
||||
return new JtaTransactionManagerFactoryBean(graphDatabaseService).getObject();
|
||||
}
|
||||
|
||||
private void createData() {
|
||||
|
||||
@@ -20,9 +20,9 @@ import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.neo4j.graphdb.GraphDatabaseService;
|
||||
import org.neo4j.kernel.GraphDatabaseAPI;
|
||||
import org.neo4j.kernel.impl.transaction.SpringTransactionManager;
|
||||
import org.neo4j.test.TestGraphDatabaseFactory;
|
||||
import org.springframework.core.convert.ConversionService;
|
||||
import org.springframework.data.neo4j.config.JtaTransactionManagerFactoryBean;
|
||||
import org.springframework.data.neo4j.core.GraphDatabase;
|
||||
import org.springframework.data.neo4j.fieldaccess.Neo4jConversionServiceFactoryBean;
|
||||
import org.springframework.data.neo4j.support.DelegatingGraphDatabase;
|
||||
@@ -51,9 +51,8 @@ public abstract class NeoApiTests {
|
||||
return new Neo4jConversionServiceFactoryBean().getObject();
|
||||
}
|
||||
|
||||
protected PlatformTransactionManager createTransactionManager()
|
||||
{
|
||||
return new JtaTransactionManager(new SpringTransactionManager((GraphDatabaseAPI)graphDatabaseService));
|
||||
protected PlatformTransactionManager createTransactionManager() {
|
||||
return new JtaTransactionManagerFactoryBean(graphDatabaseService).getObject();
|
||||
}
|
||||
|
||||
protected GraphDatabase createGraphDatabase() throws Exception
|
||||
|
||||
Reference in New Issue
Block a user