You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@polygene.apache.org by ni...@apache.org on 2015/04/17 18:43:02 UTC

[23/28] zest-qi4j git commit: QI-414 Entity creation and update from Values in 'conversion' library

QI-414 Entity creation and update from Values in 'conversion' library


Project: http://git-wip-us.apache.org/repos/asf/zest-qi4j/repo
Commit: http://git-wip-us.apache.org/repos/asf/zest-qi4j/commit/d0219fab
Tree: http://git-wip-us.apache.org/repos/asf/zest-qi4j/tree/d0219fab
Diff: http://git-wip-us.apache.org/repos/asf/zest-qi4j/diff/d0219fab

Branch: refs/heads/develop
Commit: d0219fabe53e84b21bb29a228ca2b4edceddb71f
Parents: 378e540
Author: Paul Merlin <pa...@nosphere.org>
Authored: Wed Mar 25 17:14:25 2015 +0100
Committer: Paul Merlin <pa...@nosphere.org>
Committed: Wed Mar 25 17:14:25 2015 +0100

----------------------------------------------------------------------
 .../org/qi4j/library/conversion/values/ValueToEntityMixin.java | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/d0219fab/libraries/conversion/src/main/java/org/qi4j/library/conversion/values/ValueToEntityMixin.java
----------------------------------------------------------------------
diff --git a/libraries/conversion/src/main/java/org/qi4j/library/conversion/values/ValueToEntityMixin.java b/libraries/conversion/src/main/java/org/qi4j/library/conversion/values/ValueToEntityMixin.java
index 9759fcd..b5d91bb 100644
--- a/libraries/conversion/src/main/java/org/qi4j/library/conversion/values/ValueToEntityMixin.java
+++ b/libraries/conversion/src/main/java/org/qi4j/library/conversion/values/ValueToEntityMixin.java
@@ -149,7 +149,7 @@ public class ValueToEntityMixin
     @Override
     public <T> T create( Class<T> entityType, Object value )
     {
-        return create( entityType, null, value );
+        return createInstance( doConversion( entityType, null, value ) );
     }
 
     @Override
@@ -161,7 +161,9 @@ public class ValueToEntityMixin
     @Override
     public <T> T create( Class<T> entityType, Object value, Function<T, T> prototypeOpportunity )
     {
-        return create( entityType, null, value, prototypeOpportunity );
+        EntityBuilder<?> builder = doConversion( entityType, null, value );
+        prototypeOpportunity.map( (T) builder.instance() );
+        return createInstance( builder );
     }
 
     @Override