-
Notifications
You must be signed in to change notification settings - Fork 75
Fixing templates for java model generated files import statement for … #133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…models related files.
MIchaelMainer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename 'format' to 'importFormat'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renamed.
| "models.extensions", | ||
| "PlannerChecklistItem"); | ||
| sb.Append("\n"); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move this statement after the OdcmPrimitiveType check and continue statement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved.
| } | ||
| return "<" + BaseTypeCollectionResponse(c) + ", " + ITypeCollectionPage(c) + ">"; | ||
| } | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Provide comments for the functions you add.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added comments
|
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: