Skip to content

Commit

Permalink
issue #56 fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
avurro committed Oct 19, 2016
1 parent 8a8a410 commit 9a04618
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ private StringBuilder calculateSourceNestedMapping(){
String nestedField = "nestedField"+ ++index;
for (NestedMappedField nestedMappedField : this.nestedMappingInfo.getNestedFields()) {

//TODO tenere conto del MappingType!
//TODO potrei volere il safeNavigation in alcuni punti e non in tutti
// quindi devo essere in grado di lanciare exception quando serve
tryCatch(mapping, nestedField, actualField, nestedMappedField);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ protected StringBuilder fieldToCreate() {

// name of new Object
String newObj = "obj"+count++;
return write(getMapper(newObj).mapping(newInstance, ALL_FIELDS, ALL_FIELDS),setDestination(newObj));
return write(getMapper(newObj).mapping(newInstance, ALL_FIELDS, getMts()),setDestination(newObj));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,11 @@ protected void AllValued() {
newLine + " }else{" +
newLine + " obj$i = new com.googlecode.jmapper.bean.TargetObject();" +
newLine + " }" +
newLine + " obj$i.setField(source.getMappedObject().getField());"+
newLine + " destination.setTargetObject(obj$i);"+
newLine + " }"+newLine;
newLine + " if(source.getMappedObject().getField()!=null){"+
newLine + " obj$i.setField(source.getMappedObject().getField());"+
newLine + " }"+
newLine + " destination.setTargetObject(obj$i);"+
newLine + " }"+newLine;

write(newInstance);
verify();
Expand All @@ -104,8 +106,10 @@ protected void AllValued() {
newLine + " }else{" +
newLine + " obj$i = new com.googlecode.jmapper.bean.TargetObject();" +
newLine + " }" +
newLine + " obj$i.setField(source.getMappedObject().getField());"+
newLine + " destination.setTargetObject(obj$i);"+
newLine + " if(source.getMappedObject().getField()!=null){"+
newLine + " obj$i.setField(source.getMappedObject().getField());"+
newLine + " }"+
newLine + " destination.setTargetObject(obj$i);"+
newLine + " }"+
newLine + " }"+newLine;

Expand Down Expand Up @@ -173,8 +177,11 @@ protected void NullValued() {
newLine + " }else{" +
newLine + " obj$i = new com.googlecode.jmapper.bean.TargetObject();" +
newLine + " }" +
newLine + " obj$i.setField(source.getMappedObject().getField());"+
newLine + " destination.setTargetObject(obj$i);"+

newLine + " if(source.getMappedObject().getField()!=null){"+
newLine + " obj$i.setField(source.getMappedObject().getField());"+
newLine + " }"+
newLine + " destination.setTargetObject(obj$i);"+
newLine + " }"+
newLine + " }"+newLine;

Expand Down

0 comments on commit 9a04618

Please sign in to comment.