-
Notifications
You must be signed in to change notification settings - Fork 123
Dedicated chapter about code generation configuration #1850
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
base: main
Are you sure you want to change the base?
Conversation
@@ -63,3 +63,151 @@ properties: | |||
:::warning SAP Business Application Studio | |||
If you develop your application in SAP Business Application Studio and Java 21 is not available there, use the Java 17, instead. | |||
::: | |||
|
|||
## Configuring Code Generation for Typed Access {#codegen-config} |
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.
Maybe rather put this whole paragraph into the "Building Applications" section?
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.
Order was to do it here. :) I thought that we need introduce new top-level chapter: there is much more stuff that needs to be documented.
|
||
Moreover, it doesn't change the way how event contexts and entities, delivered by CAP, look like. Such interfaces from CAP are always modelled in the default JavaBeans style. | ||
|
||
### Code Generation Features |
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.
Is this doc already reflecting the 4.0.0 state regarding defaults of these parameters?
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.
Whatever remains available in 4.0 is described, except stuff that is not intended for POM at all.
|
||
- Names from CDS model that are Java keywords are prefixed with `_`. | ||
- Names from CDS model that use characters that are not valid as Java identifiers, are replaced by `_`. This, however, might lead to a conflicts between names that yield same name in Java. | ||
- Characters `/` and `$` behave just like `_`: they used to provide camel-cased name and provide better support for models coming from ABAP systems. |
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.
they used to provide camel-cased name and provide better support for models coming from ABAP systems.
Can you clarify that. I am not sure if I understand that sentence.
EDIT: Ah I think I got it, they are not replaced by "" but behave like a "" would. Maybe it would be beneficial to explain how a "_" behaves. This is not explicitly explained here at the moment.
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.
I rather use something more generic to avoid deep dives in the implementation details.
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.
Well I think it is helpful that these rules are explained. They are very visible and I wouldn't consider it an implementation detail.
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.
To which extent?
:::warning Check migration guides! | ||
In major releases of CAP Java, some of these switches can be made new default and some other switches might be removed. This might introduce compile errors | ||
in your application that needs to be fixed. | ||
::: |
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.
I guess this warning is not really required here. We should always document the latest version. All things related to major versions can be mentioned in the migration guides. I don't think we need to emphasize that here explicitly.
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.
It was intended as a reminder to someone who comes here from search and somehow confused why some switch is no longer mentioned or why they have compile errors now.
Introduces chapter to describe switches in Java Code generator. Previously that was documented in the Maven Plugin. This chapter somewhat repeats that documentation and aims to improve the visibility of said switches.