From adca8458d244f630ec8c3dc7c5bca0fc8ff1f992 Mon Sep 17 00:00:00 2001 From: Michael Hunger Date: Thu, 13 Oct 2011 21:49:00 +0200 Subject: [PATCH] fixed bug, with returning the wrong state from useOrCreateState --- .../springframework/data/neo4j/support/EntityStateHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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()) {