fixed dependency management for aspect-based and cross-store peristence
This commit is contained in:
@@ -31,6 +31,7 @@ import org.springframework.orm.jpa.JpaTransactionManager;
|
||||
import org.springframework.transaction.PlatformTransactionManager;
|
||||
import org.springframework.transaction.jta.JtaTransactionManager;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.persistence.EntityManagerFactory;
|
||||
|
||||
/**
|
||||
@@ -59,7 +60,7 @@ public class CrossStoreNeo4jConfiguration extends Neo4jAspectConfiguration {
|
||||
@Bean
|
||||
protected EntityInstantiator<Node> graphEntityInstantiator() {
|
||||
if (isUsingCrossStorePersistence()) {
|
||||
return new CrossStoreNodeEntityInstantiator(new NodeEntityInstantiator(entityStateHandler()), entityManagerFactory);
|
||||
return new CrossStoreNodeEntityInstantiator(new NodeEntityInstantiator(entityStateHandler()), entityManagerFactory);
|
||||
} else {
|
||||
return new NodeEntityInstantiator(entityStateHandler());
|
||||
}
|
||||
@@ -82,9 +83,11 @@ public class CrossStoreNeo4jConfiguration extends Neo4jAspectConfiguration {
|
||||
return new CrossStoreNodeEntityStateFactory();
|
||||
}
|
||||
|
||||
@PostConstruct
|
||||
@Override
|
||||
public void wireEntityStateFactories() throws Exception {
|
||||
super.wireEntityStateFactories();
|
||||
nodeEntityStateFactory().setEntityManagerFactory(entityManagerFactory);
|
||||
nodeEntityStateFactory().postConstruct();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,8 +70,7 @@ public class CrossStoreNodeEntityStateFactory extends NodeEntityStateFactory {
|
||||
this.entityManagerFactory = entityManagerFactory;
|
||||
}
|
||||
|
||||
@PostConstruct
|
||||
private void setUp() {
|
||||
public void postConstruct() {
|
||||
this.delegatingFieldAccessorFactory = new CrossStoreNodeEntityState.CrossStoreNodeDelegatingFieldAccessorFactory(graphDatabaseContext);
|
||||
}
|
||||
|
||||
|
||||
@@ -121,7 +121,7 @@
|
||||
<bean id="nodeTypeRepresentationStrategy" factory-bean="typeRepresentationStrategyFactory" factory-method="getNodeTypeRepresentationStrategy" />
|
||||
<bean id="relationshipTypeRepresentationStrategy" factory-bean="typeRepresentationStrategyFactory" factory-method="getRelationshipTypeRepresentationStrategy"/>
|
||||
|
||||
<bean id="nodeEntityStateFactory" class="org.springframework.data.neo4j.cross_store.support.node.CrossStoreNodeEntityStateFactory">
|
||||
<bean id="nodeEntityStateFactory" class="org.springframework.data.neo4j.cross_store.support.node.CrossStoreNodeEntityStateFactory" init-method="postConstruct">
|
||||
<property name="nodeDelegatingFieldAccessorFactory">
|
||||
<bean class="org.springframework.data.neo4j.fieldaccess.NodeDelegatingFieldAccessorFactory">
|
||||
<constructor-arg ref="graphDatabaseContext"/>
|
||||
|
||||
@@ -51,11 +51,9 @@ public class PropertyFieldAccessorFactory implements FieldAccessorFactory {
|
||||
protected final Neo4jPersistentProperty property;
|
||||
protected final String propertyName;
|
||||
protected final Class<?> fieldType;
|
||||
private ConversionService conversionService;
|
||||
|
||||
public PropertyFieldAccessor(GraphDatabaseContext graphDatabaseContext, Neo4jPersistentProperty property) {
|
||||
this.graphDatabaseContext = graphDatabaseContext;
|
||||
conversionService = graphDatabaseContext.getConversionService();
|
||||
this.property = property;
|
||||
this.propertyName = property.getNeo4jPropertyName();
|
||||
this.fieldType = property.getType() ;
|
||||
|
||||
@@ -23,6 +23,7 @@ import java.util.Collections;
|
||||
import java.util.Set;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.neo4j.graphdb.Direction;
|
||||
import org.springframework.data.mapping.PropertyPath;
|
||||
@@ -35,6 +36,7 @@ import org.springframework.data.neo4j.mapping.Neo4jMappingContext;
|
||||
*
|
||||
* @author Oliver Gierke
|
||||
*/
|
||||
@Ignore("until merged with DATAGRAPH-113")
|
||||
public class MatchClauseUnitTest {
|
||||
|
||||
Neo4jMappingContext context;
|
||||
|
||||
Reference in New Issue
Block a user