-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Batch load stuff #11063
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
Batch load stuff #11063
Conversation
1. use typesafe logging methods 2. use 'var' 3. don't use Array.newInstance() when new Object[] works
...nate-core/src/main/java/org/hibernate/loader/ast/internal/AbstractCollectionBatchLoader.java
Fixed
Show fixed
Hide fixed
the existence of this assertion was forcing array-based batch loaders to use Array.newInstance() when it looks like the JDBC drivers don't require that
assert bindValue == null || jdbcMapping == null || jdbcMapping.getJdbcJavaType().isInstance( bindValue ) | ||
: String.format( Locale.ROOT, "Unexpected value type (expected : %s) : %s (%s)", | ||
jdbcMapping.getJdbcJavaType().getJavaTypeClass().getName(), bindValue, bindValue.getClass().getName() ); | ||
// assert bindValue == null || jdbcMapping == null || jdbcMapping.getJdbcJavaType().isInstance( bindValue ) |
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 purpose of this assertion was to protect us from using the wrong values when creating binding values, ensuring that we use the proper jdbc value representation instead of the domain value. I remember that this assertion helped us identify wrong translations in the past, so I'd rather not see it going. It would be nice if we could simply special case arrays i.e. add || jdbcMapping.getJdbcJavaType() instanceof BasicPluralJavaType<?> && bindValue instanceof Object[]
. It's a bit sad that we loose the type-checkability by using Object[]
, but I understand the need to get rid of typed arrays to reduce the amount of metadata for Quarkus.
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 would be nice if we could simply special case arrays i.e. add
|| jdbcMapping.getJdbcJavaType() instanceof BasicPluralJavaType<?> && bindValue instanceof Object[]
.
Oh, sure, that's fine by me.
[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.