cyclic dependencies and remove dependency on DirectGraphRepositoryFactory in TraversalFieldAccessor

This commit is contained in:
Michael Hunger
2011-04-12 16:35:20 +02:00
parent 9d4eab6e77
commit 769bb8c4da
9 changed files with 7 additions and 16 deletions

View File

@@ -148,7 +148,6 @@ public class Neo4jConfiguration {
public RelationshipEntityStateFactory relationshipEntityStateFactory() throws Exception {
RelationshipEntityStateFactory entityStateFactory = new RelationshipEntityStateFactory();
entityStateFactory.setGraphDatabaseContext(graphDatabaseContext());
entityStateFactory.setGraphRepositoryFactory(directGraphRepositoryFactory());
return entityStateFactory;
}

View File

@@ -25,7 +25,6 @@ import org.neo4j.graphdb.Node;
import org.neo4j.graphdb.Relationship;
import org.neo4j.graphdb.traversal.TraversalDescription;
import org.neo4j.graphdb.traversal.Traverser;
import org.springframework.data.graph.core.GraphBacked;
import org.springframework.data.graph.core.NodeBacked;
import org.springframework.data.graph.core.RelationshipBacked;
import org.springframework.data.graph.neo4j.support.DoReturn;
@@ -37,6 +36,8 @@ import org.springframework.data.graph.annotation.*;
import javax.persistence.Transient;
import javax.persistence.Entity;
import org.springframework.data.graph.neo4j.support.path.EntityPathPathIterableWrapper;
import java.lang.reflect.Field;
import static org.springframework.data.graph.neo4j.support.DoReturn.unwrap;

View File

@@ -26,7 +26,6 @@ import org.springframework.data.graph.core.GraphBacked;
import org.springframework.data.graph.core.NodeBacked;
import org.springframework.data.graph.core.RelationshipBacked;
import org.springframework.data.graph.neo4j.support.GraphDatabaseContext;
import org.springframework.data.graph.neo4j.support.relationship.DefaultRelationshipBacked;
import java.util.Iterator;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.data.graph.neo4j.support.relationship;
package org.springframework.data.graph.neo4j.support.path;
import org.springframework.data.graph.annotation.EndNode;
import org.springframework.data.graph.annotation.RelationshipEntity;

View File

@@ -14,12 +14,13 @@
* limitations under the License.
*/
package org.springframework.data.graph.neo4j.support;
package org.springframework.data.graph.neo4j.support.path;
import org.neo4j.graphdb.Path;
import org.neo4j.graphdb.traversal.Evaluation;
import org.neo4j.graphdb.traversal.Evaluator;
import org.springframework.data.graph.core.NodeBacked;
import org.springframework.data.graph.neo4j.support.GraphDatabaseContext;
import org.springframework.data.graph.neo4j.support.path.ConvertingEntityPath;
/**

View File

@@ -14,13 +14,12 @@
* limitations under the License.
*/
package org.springframework.data.graph.neo4j.support.node;
package org.springframework.data.graph.neo4j.support.path;
import org.neo4j.graphdb.Path;
import org.neo4j.helpers.collection.IterableWrapper;
import org.springframework.data.graph.core.EntityPath;
import org.springframework.data.graph.core.NodeBacked;
import org.springframework.data.graph.neo4j.support.path.ConvertingEntityPath;
import org.springframework.data.graph.neo4j.support.GraphDatabaseContext;
/**

View File

@@ -17,9 +17,8 @@
package org.springframework.data.graph.neo4j.support.relationship;
import org.neo4j.graphdb.Relationship;
import org.springframework.data.graph.core.RelationshipBacked;
import org.springframework.data.graph.neo4j.repository.DirectGraphRepositoryFactory;
import org.springframework.data.graph.core.EntityState;
import org.springframework.data.graph.core.RelationshipBacked;
import org.springframework.data.graph.neo4j.support.GraphDatabaseContext;
import javax.annotation.PostConstruct;
@@ -28,7 +27,6 @@ public class RelationshipEntityStateFactory {
private GraphDatabaseContext graphDatabaseContext;
private DirectGraphRepositoryFactory graphRepositoryFactory;
private RelationshipEntityState.RelationshipStateDelegatingFieldAccessorFactory delegatingFieldAccessorFactory;
public EntityState<RelationshipBacked, Relationship> getEntityState(final RelationshipBacked entity) {
@@ -39,10 +37,6 @@ public class RelationshipEntityStateFactory {
this.graphDatabaseContext = graphDatabaseContext;
}
public void setGraphRepositoryFactory(DirectGraphRepositoryFactory graphRepositoryFactory) {
this.graphRepositoryFactory = graphRepositoryFactory;
}
@PostConstruct
private void setUp() {
this.delegatingFieldAccessorFactory = new RelationshipEntityState.RelationshipStateDelegatingFieldAccessorFactory(graphDatabaseContext);

View File

@@ -124,7 +124,6 @@
<bean id="relationshipEntityStateFactory" class="org.springframework.data.graph.neo4j.support.relationship.RelationshipEntityStateFactory">
<property name="graphDatabaseContext" ref="graphDatabaseContext"/>
<property name="graphRepositoryFactory" ref="graphRepositoryFactory"/>
</bean>

View File

@@ -120,7 +120,6 @@
<bean id="relationshipEntityStateFactory" class="org.springframework.data.graph.neo4j.support.relationship.RelationshipEntityStateFactory">
<property name="graphDatabaseContext" ref="graphDatabaseContext"/>
<property name="graphRepositoryFactory" ref="graphRepositoryFactory"/>
</bean>
<bean id="graphRepositoryFactory" class="org.springframework.data.graph.neo4j.repository.DirectGraphRepositoryFactory">