-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
jdl: error passing 0
value in field annotations.
#28312
Labels
Comments
The bug is in JDL parsing. You can use |
0
value in field annotations.
I not sure if |
No, at the moment it is not expected that you don't pass a value. So, there should always be a parameter here. |
3 tasks
Fixed by #28753 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Issue Description
When adding new fields with
@defaultValue
in a JHipster entity, the generated Liquibase changelog does not correctly set the default values in the database. Specifically, the changelog generates the following incorrect XML:This leads to the following problems:
defaultValueNumeric="true"
is invalid and does not set the intended default value (e.g.,0
).NULL
values, even though the@defaultValue
annotation implies it should beNOT NULL
.Steps to Reproduce
@defaultValue
annotations:Expected Behavior
The generated changelog should correctly define default values and nullable constraints. For example:
Observed Behavior
The generated changelog incorrectly defines the columns as follows:
Environment
Additional Context
This issue can lead to runtime errors or misaligned database schemas, especially when default values and non-null constraints are crucial for business logic.
Proposed Solution
Update the generator to:
defaultValueNumeric
is set to the numeric value provided in the@defaultValue
annotation.nullable="false"
if a@defaultValue
is defined.The text was updated successfully, but these errors were encountered: