Skip to content
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

HHH-16049 Setting a property to its current value with bytecode enhancement enabled results in unnecessary SQL Update in some (many) cases #5967

Merged
merged 4 commits into from
Jan 24, 2023

Conversation

dreab8
Copy link
Member

@dreab8 dreab8 commented Jan 17, 2023

@@ -20,7 +20,7 @@
Object b) {
final PersistentAttributeInterceptor persistentAttributeInterceptor = persistentAttributeInterceptable.$$_hibernate_getInterceptor();
if ( persistentAttributeInterceptor != null
&& !persistentAttributeInterceptor.getInitializedLazyAttributeNames().contains( fieldName ) ) {
&& !persistentAttributeInterceptor.isAttributeLoaded( fieldName ) ) {

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation

Invoking [PersistentAttributeInterceptor.isAttributeLoaded](1) should be avoided because it has been deprecated.
@@ -33,7 +33,7 @@
boolean b) {
final PersistentAttributeInterceptor persistentAttributeInterceptor = persistentAttributeInterceptable.$$_hibernate_getInterceptor();
if ( persistentAttributeInterceptor != null
&& !persistentAttributeInterceptor.getInitializedLazyAttributeNames().contains( fieldName ) ) {
&& !persistentAttributeInterceptor.isAttributeLoaded( fieldName ) ) {

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation

Invoking [PersistentAttributeInterceptor.isAttributeLoaded](1) should be avoided because it has been deprecated.
@@ -46,7 +46,7 @@
byte b) {
final PersistentAttributeInterceptor persistentAttributeInterceptor = persistentAttributeInterceptable.$$_hibernate_getInterceptor();
if ( persistentAttributeInterceptor != null
&& !persistentAttributeInterceptor.getInitializedLazyAttributeNames().contains( fieldName ) ) {
&& !persistentAttributeInterceptor.isAttributeLoaded( fieldName ) ) {

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation

Invoking [PersistentAttributeInterceptor.isAttributeLoaded](1) should be avoided because it has been deprecated.
@@ -59,7 +59,7 @@
short b) {
final PersistentAttributeInterceptor persistentAttributeInterceptor = persistentAttributeInterceptable.$$_hibernate_getInterceptor();
if ( persistentAttributeInterceptor != null
&& !persistentAttributeInterceptor.getInitializedLazyAttributeNames().contains( fieldName ) ) {
&& !persistentAttributeInterceptor.isAttributeLoaded( fieldName ) ) {

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation

Invoking [PersistentAttributeInterceptor.isAttributeLoaded](1) should be avoided because it has been deprecated.
@@ -72,7 +72,7 @@
char b) {
final PersistentAttributeInterceptor persistentAttributeInterceptor = persistentAttributeInterceptable.$$_hibernate_getInterceptor();
if ( persistentAttributeInterceptor != null
&& !persistentAttributeInterceptor.getInitializedLazyAttributeNames().contains( fieldName ) ) {
&& !persistentAttributeInterceptor.isAttributeLoaded( fieldName ) ) {

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation

Invoking [PersistentAttributeInterceptor.isAttributeLoaded](1) should be avoided because it has been deprecated.
@@ -85,7 +85,7 @@
int b) {
final PersistentAttributeInterceptor persistentAttributeInterceptor = persistentAttributeInterceptable.$$_hibernate_getInterceptor();
if ( persistentAttributeInterceptor != null
&& !persistentAttributeInterceptor.getInitializedLazyAttributeNames().contains( fieldName ) ) {
&& !persistentAttributeInterceptor.isAttributeLoaded( fieldName ) ) {

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation

Invoking [PersistentAttributeInterceptor.isAttributeLoaded](1) should be avoided because it has been deprecated.
@@ -98,7 +98,7 @@
long b) {
final PersistentAttributeInterceptor persistentAttributeInterceptor = persistentAttributeInterceptable.$$_hibernate_getInterceptor();
if ( persistentAttributeInterceptor != null
&& !persistentAttributeInterceptor.getInitializedLazyAttributeNames().contains( fieldName ) ) {
&& !persistentAttributeInterceptor.isAttributeLoaded( fieldName ) ) {

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation

Invoking [PersistentAttributeInterceptor.isAttributeLoaded](1) should be avoided because it has been deprecated.
@@ -111,7 +111,7 @@
float b) {
final PersistentAttributeInterceptor persistentAttributeInterceptor = persistentAttributeInterceptable.$$_hibernate_getInterceptor();
if ( persistentAttributeInterceptor != null
&& !persistentAttributeInterceptor.getInitializedLazyAttributeNames().contains( fieldName ) ) {
&& !persistentAttributeInterceptor.isAttributeLoaded( fieldName ) ) {

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation

Invoking [PersistentAttributeInterceptor.isAttributeLoaded](1) should be avoided because it has been deprecated.
@@ -124,7 +124,7 @@
double b) {
final PersistentAttributeInterceptor persistentAttributeInterceptor = persistentAttributeInterceptable.$$_hibernate_getInterceptor();
if ( persistentAttributeInterceptor != null
&& !persistentAttributeInterceptor.getInitializedLazyAttributeNames().contains( fieldName ) ) {
&& !persistentAttributeInterceptor.isAttributeLoaded( fieldName ) ) {

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation

Invoking [PersistentAttributeInterceptor.isAttributeLoaded](1) should be avoided because it has been deprecated.
@dreab8 dreab8 force-pushed the yrodiere-HHH-16049 branch from 331515b to 8005807 Compare January 17, 2023 13:37
@Postremus
Copy link

Nice, looks like my workaround (using interceptor) was correct using isAttributeLoaded.
quarkusio/quarkus#30234 (comment)

Thank you for working on this! <3

Copy link
Member

@beikov beikov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dreab8 dreab8 merged commit 0983b47 into hibernate:main Jan 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants