-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
HHH-19749/HHH-18860 Make casts for Oracle merge statement column mapping specific #11201
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
| @Override | ||
| public @Nullable String getCustomReadExpression() { | ||
| return null; | ||
| public static class KeyColumn extends SelectableMappingImpl implements TableDetails.KeyColumn { |
Check notice
Code scanning / CodeQL
Class has same name as super class Note
org.hibernate.metamodel.mapping.TableDetails$KeyColumn
f0940a8 to
89e13a5
Compare
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.
Overall, seemed reasonable to me. I did have one confusion I noted.
| @Override | ||
| public String getSelectableName() { | ||
| return selectablePath == null ? null : selectablePath.getSelectableName(); | ||
| return selectablePath.getSelectableName(); |
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'm a little confused here... You explicitly marked selectablePath as nullable, but then removed the null handling?
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.
The constructor argument is @Nullable, but the field is non-null since that is handled in the constructor.
this.selectablePath = selectablePath == null ? new SelectablePath( selectionExpression ) : selectablePath;
| return dialect.getDoublePrecision(); | ||
| } | ||
| else { | ||
| return Math.min( dialect.getDefaultDecimalPrecision(), (int) ceil( dialect.getDoublePrecision() * LOG_BASE10OF2 ) ); |
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.
@beikov I don't understand this logic, and it looks wrong to me. Why would dialect.getDoublePrecision() come into it if we're not using a floating-point type on the database side? Note that dialect.getDoublePrecision() returns a value that might be measured in binary or decimal digits depending on the database, and so multiplying it by log_10(2) is probably wrong. It's only meant as an argument to the float(n) type.
Perhaps this should be the number of decimal digits of precision in a Java double, i.e. 17?
| return dialect.getFloatPrecision(); | ||
| } | ||
| else { | ||
| return Math.min( dialect.getDefaultDecimalPrecision(), (int) ceil( dialect.getFloatPrecision() * LOG_BASE10OF2 ) ); |
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.
Similarly, should this just be 8 instead of using dialect.getFloatPrecision()?
[Please describe here what your change is about]
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license
and can be relicensed under the terms of the LGPL v2.1 license in the future at the maintainers' discretion.
For more information on licensing, please check here.
https://hibernate.atlassian.net/browse/HHH-19749
https://hibernate.atlassian.net/browse/HHH-18860