fixed NotFoundException with repository.exists
This commit is contained in:
@@ -54,6 +54,11 @@
|
||||
<groupId>org.neo4j</groupId>
|
||||
<artifactId>neo4j</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.neo4j</groupId>
|
||||
<artifactId>neo4j-cypher-plugin</artifactId>
|
||||
<version>${neo4j.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.neo4j.app</groupId>
|
||||
<artifactId>neo4j-server</artifactId>
|
||||
|
||||
@@ -25,6 +25,7 @@ import org.neo4j.graphdb.traversal.TraversalDescription;
|
||||
import org.springframework.data.graph.core.GraphDatabase;
|
||||
import org.springframework.data.graph.core.Property;
|
||||
import org.springframework.data.graph.neo4j.rest.support.index.RestIndexManager;
|
||||
import org.springframework.data.graph.neo4j.support.query.QueryEngine;
|
||||
|
||||
import javax.ws.rs.core.Response.Status;
|
||||
import java.net.URI;
|
||||
@@ -96,6 +97,11 @@ public class RestGraphDatabase implements GraphDatabaseService, GraphDatabase {
|
||||
return new RestTraversal();
|
||||
}
|
||||
|
||||
@Override
|
||||
public QueryEngine queryEngineFor(QueryEngine.Type type) {
|
||||
return new RestQueryEngine(restRequest);
|
||||
}
|
||||
|
||||
public RestIndexManager index() {
|
||||
return new RestIndexManager( restRequest, this );
|
||||
}
|
||||
|
||||
@@ -19,6 +19,8 @@ package org.springframework.data.graph.neo4j.rest.support.index;
|
||||
import com.sun.jersey.api.client.ClientResponse;
|
||||
import org.neo4j.graphdb.Node;
|
||||
import org.neo4j.graphdb.PropertyContainer;
|
||||
import org.neo4j.graphdb.Relationship;
|
||||
import org.neo4j.graphdb.index.AutoIndexer;
|
||||
import org.neo4j.graphdb.index.Index;
|
||||
import org.neo4j.graphdb.index.IndexManager;
|
||||
import org.neo4j.graphdb.index.RelationshipIndex;
|
||||
@@ -89,5 +91,16 @@ public class RestIndexManager implements IndexManager {
|
||||
public String removeConfiguration( Index<? extends PropertyContainer> index, String s ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AutoIndexer<Node> getNodeAutoIndexer() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AutoIndexer<Relationship> getRelationshipAutoIndexer() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -238,7 +238,11 @@ public abstract class AbstractGraphRepository<S extends PropertyContainer, T ext
|
||||
|
||||
@Override
|
||||
public boolean exists(Long id) {
|
||||
return getById(id)!=null;
|
||||
try {
|
||||
return getById(id)!=null;
|
||||
} catch (NotFoundException e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user