diff --git a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/support/EntityStateHandler.java b/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/support/EntityStateHandler.java index c7e3fef84..ddd9861b3 100644 --- a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/support/EntityStateHandler.java +++ b/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/support/EntityStateHandler.java @@ -106,7 +106,7 @@ public class EntityStateHandler { public S useOrCreateState(Object entity, S state) { if (state != null) return state; final S containedState = getPersistentState(entity); - if (containedState == null) return containedState; + if (containedState != null) return containedState; final Class type = entity.getClass(); final Neo4jPersistentEntityImpl persistentEntity = mappingContext.getPersistentEntity(type); if (persistentEntity.isNodeEntity()) {