Fixing templates for java model generated files import statement for …#133
Fixing templates for java model generated files import statement for …#133deepak2016 merged 2 commits intodevfrom
Conversation
…models related files.
MIchaelMainer
left a comment
There was a problem hiding this comment.
This looks good. I've add a couple minor review entries.
| import java.util.EnumSet;", host.CurrentModel.NamespaceName()); | ||
|
|
||
| sb.Append("\n"); | ||
| var format = @"import {0}.{1}.{2};"; |
There was a problem hiding this comment.
rename 'format' to 'importFormat'
| "models.extensions", | ||
| "PlannerChecklistItem"); | ||
| sb.Append("\n"); | ||
| } |
There was a problem hiding this comment.
Why are we special casing BasePlannerAssignments and BasePlannerChecklistItems? What are we getting here that we don't get from within the if(baseClassNameType != ""). Assuming there is good reason for this, we should consider maintaining a list of extension files outside of the template logic code and then document the use of this file.
There was a problem hiding this comment.
These are due to overrides present in CustomOverwrites.cs file. Needed to handle these cases separately.
| { | ||
| foreach (var property in properties.Where(p => p.IsCollection() && p.IsNavigation())) | ||
| { | ||
| var propertyType = BaseTypeCollectionResponse(property); |
There was a problem hiding this comment.
Move this statement after the OdcmPrimitiveType check and continue statement.
| } | ||
| return "<" + BaseTypeCollectionResponse(c) + ", " + ITypeCollectionPage(c) + ">"; | ||
| } | ||
|
|
There was a problem hiding this comment.
Provide comments for the functions you add.
|
I'd like to add a step 1A to the review for change steps: |
… generate correct import statement
…models related files.
This is an initial change to fix imports for java files. (Formatting appearing in visual studio and in github change looks a bit different)
These changes in templates only fixes the import statements and doesn't change any other content of the java files.
Testing steps: