polygene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nic...@apache.org
Subject [45/50] [abbrv] zest-qi4j git commit: QI-414 Entity creation and update from Values in 'conversion' library
Date Fri, 24 Apr 2015 06:36:58 GMT
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/master
Commit: d0219fabe53e84b21bb29a228ca2b4edceddb71f
Parents: 378e540
Author: Paul Merlin <paul@nosphere.org>
Authored: Wed Mar 25 17:14:25 2015 +0100
Committer: Paul Merlin <paul@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


Mime
View raw message