}
if (this.conversionService==null) {
this.conversionService=new Neo4jConversionServiceFactoryBean().getObject();
}
if (entityStateHandler == null) {
entityStateHandler = new EntityStateHandler(mappingContext,graphDatabase, conversionService);
}
if (nodeEntityInstantiator == null) {
nodeEntityInstantiator = new NodeEntityInstantiator(entityStateHandler);
}
if (relationshipEntityInstantiator == null) {
relationshipEntityInstantiator = new RelationshipEntityInstantiator(entityStateHandler);
}
if (this.typeRepresentationStrategyFactory == null) {
this.typeRepresentationStrategyFactory = typeRepresentationStrategy!=null ? new TypeRepresentationStrategyFactory(graphDatabase,typeRepresentationStrategy) : new TypeRepresentationStrategyFactory(graphDatabase);
}
if (this.nodeTypeRepresentationStrategy == null) {
this.nodeTypeRepresentationStrategy = typeRepresentationStrategyFactory.getNodeTypeRepresentationStrategy();
}
if (this.relationshipTypeRepresentationStrategy == null) {
this.relationshipTypeRepresentationStrategy = typeRepresentationStrategyFactory.getRelationshipTypeRepresentationStrategy();
}
if (this.nodeEntityStateFactory==null) {
this.nodeEntityStateFactory = new NodeEntityStateFactory(mappingContext, new NodeDelegatingFieldAccessorFactory.Factory());
}
if (this.relationshipEntityStateFactory==null) {
this.relationshipEntityStateFactory = new RelationshipEntityStateFactory(mappingContext, new RelationshipDelegatingFieldAccessorFactory.Factory());
}
this.typeRepresentationStrategies = new TypeRepresentationStrategies(mappingContext, nodeTypeRepresentationStrategy, relationshipTypeRepresentationStrategy);
final EntityStateHandler entityStateHandler = new EntityStateHandler(mappingContext, graphDatabase, conversionService);
EntityTools<Node> nodeEntityTools = new EntityTools<Node>(nodeTypeRepresentationStrategy, nodeEntityStateFactory, nodeEntityInstantiator, mappingContext);
EntityTools<Relationship> relationshipEntityTools = new EntityTools<Relationship>(relationshipTypeRepresentationStrategy, relationshipEntityStateFactory, relationshipEntityInstantiator, mappingContext);
this.entityPersister = new Neo4jEntityPersister(conversionService, nodeEntityTools, relationshipEntityTools, mappingContext, entityStateHandler);
this.entityRemover = new EntityRemover(this.entityStateHandler, nodeTypeRepresentationStrategy, relationshipTypeRepresentationStrategy, graphDatabase);
if (this.resultConverter == null) {