-
-
Notifications
You must be signed in to change notification settings - Fork 101
Better error message when transparently loading lazy fields #2513
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
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.
Thanks a lot,
a couple of things caught my eyes while giving it a very quick pass.
I will have a better look as soon as I finished with all the other non-draft PRs
...sts/bytecode-enhancements-it/src/test/java/org/hibernate/reactive/it/LazyBasicFieldTest.java
Show resolved
Hide resolved
hibernate-reactive-core/src/main/java/org/hibernate/reactive/logging/impl/Log.java
Outdated
Show resolved
Hide resolved
...ate-reactive-core/src/main/java/org/hibernate/reactive/session/impl/ReactiveSessionImpl.java
Show resolved
Hide resolved
… loading lazy fields
a241992
to
52e3dfc
Compare
|
||
@Override | ||
public Object getJandexView() { | ||
return delegate.getJandexView(); |
Check notice
Code scanning / CodeQL
Deprecated method or constructor invocation Note
BootstrapContext.getJandexView
} | ||
|
||
@Override | ||
public LazyAttributeLoadingInterceptor injectInterceptor( |
Check notice
Code scanning / CodeQL
Confusing overloading of methods Note
BytecodeEnhancementMetadataPojoImpl.injectInterceptor
.withTransaction( session -> session.persist( emily ) ) | ||
.chain( () -> getMutinySessionFactory().withSession( session -> { | ||
Crew crew = session.getReference( Crew.class, emily.getId() ); | ||
String role = crew.getRole(); |
Check notice
Code scanning / CodeQL
Unread local variable Note test
} | ||
|
||
public static <U extends Throwable> Uni<U> assertThrown(Class<U> expectedException, Uni<?> uni) { | ||
return uni.onItemOrFailure().transform( (s, e) -> { |
Check notice
Code scanning / CodeQL
Useless parameter Note test
if ( obj == null ) { | ||
return 0; | ||
} | ||
return Long.parseLong( (String) obj ); |
Check notice
Code scanning / CodeQL
Missing catch of NumberFormatException Note test
Fix #1770
This PR aims to intercept direct access to lazy fields in order to throw a better error message, see ReactiveEnhancementAsProxyLazinessInterceptor and ReactiveLazyAttributeLoadingInterceptor
This PR needs hibernate/hibernate-orm#10950