Skip to content

Commit 409640c

Browse files
dreab8sebersole
authored andcommitted
HHH-18442 Drop DynamicInsert#value and DynamicUpdate#value
1 parent 8eb7d54 commit 409640c

File tree

7 files changed

+5
-53
lines changed

7 files changed

+5
-53
lines changed

hibernate-core/src/main/java/org/hibernate/annotations/DynamicInsert.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,4 @@
2626
@Target( TYPE )
2727
@Retention( RUNTIME )
2828
public @interface DynamicInsert {
29-
/**
30-
* @deprecated When {@code false}, this annotation has no effect.
31-
*/
32-
@Deprecated(since = "6.0")
33-
boolean value() default true;
3429
}

hibernate-core/src/main/java/org/hibernate/annotations/DynamicUpdate.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,4 @@
2727
@Target( TYPE )
2828
@Retention( RUNTIME )
2929
public @interface DynamicUpdate {
30-
/**
31-
* @deprecated When {@code false}, this annotation has no effect.
32-
*/
33-
@Deprecated(since = "6.0")
34-
boolean value() default true;
3530
}

hibernate-core/src/main/java/org/hibernate/boot/model/internal/EntityBinder.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1263,10 +1263,10 @@ public boolean isPropertyDefinedInSuperHierarchy(String name) {
12631263

12641264
private void bindRowManagement() {
12651265
final DynamicInsert dynamicInsertAnn = annotatedClass.getAnnotationUsage( DynamicInsert.class, getSourceModelContext() );
1266-
persistentClass.setDynamicInsert( dynamicInsertAnn != null && dynamicInsertAnn.value() );
1266+
persistentClass.setDynamicInsert( dynamicInsertAnn != null );
12671267

12681268
final DynamicUpdate dynamicUpdateAnn = annotatedClass.getAnnotationUsage( DynamicUpdate.class, getSourceModelContext() );
1269-
persistentClass.setDynamicUpdate( dynamicUpdateAnn != null && dynamicUpdateAnn.value() );
1269+
persistentClass.setDynamicUpdate( dynamicUpdateAnn != null );
12701270

12711271
if ( persistentClass.useDynamicInsert() && annotatedClass.hasAnnotationUsage( SQLInsert.class, getSourceModelContext() ) ) {
12721272
throw new AnnotationException( "Entity '" + name + "' is annotated both '@DynamicInsert' and '@SQLInsert'" );

hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/DynamicInsertAnnotation.java

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,42 +20,27 @@
2020
@SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" })
2121
@jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor")
2222
public class DynamicInsertAnnotation implements DynamicInsert {
23-
private boolean value;
2423

2524
/**
2625
* Used in creating dynamic annotation instances (e.g. from XML)
2726
*/
2827
public DynamicInsertAnnotation(SourceModelBuildingContext modelContext) {
29-
this.value = true;
3028
}
3129

3230
/**
3331
* Used in creating annotation instances from JDK variant
3432
*/
3533
public DynamicInsertAnnotation(DynamicInsert annotation, SourceModelBuildingContext modelContext) {
36-
this.value = annotation.value();
3734
}
3835

3936
/**
4037
* Used in creating annotation instances from Jandex variant
4138
*/
4239
public DynamicInsertAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) {
43-
this.value = extractJandexValue( annotation, HibernateAnnotations.DYNAMIC_INSERT, "value", modelContext );
4440
}
4541

4642
@Override
4743
public Class<? extends Annotation> annotationType() {
4844
return DynamicInsert.class;
4945
}
50-
51-
@Override
52-
public boolean value() {
53-
return value;
54-
}
55-
56-
public void value(boolean value) {
57-
this.value = value;
58-
}
59-
60-
6146
}

hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/DynamicUpdateAnnotation.java

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,36 +25,22 @@ public class DynamicUpdateAnnotation implements DynamicUpdate {
2525
* Used in creating dynamic annotation instances (e.g. from XML)
2626
*/
2727
public DynamicUpdateAnnotation(SourceModelBuildingContext modelContext) {
28-
this.value = true;
2928
}
3029

3130
/**
3231
* Used in creating annotation instances from JDK variant
3332
*/
3433
public DynamicUpdateAnnotation(DynamicUpdate annotation, SourceModelBuildingContext modelContext) {
35-
this.value = annotation.value();
3634
}
3735

3836
/**
3937
* Used in creating annotation instances from Jandex variant
4038
*/
4139
public DynamicUpdateAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) {
42-
this.value = extractJandexValue( annotation, HibernateAnnotations.DYNAMIC_UPDATE, "value", modelContext );
4340
}
4441

4542
@Override
4643
public Class<? extends Annotation> annotationType() {
4744
return DynamicUpdate.class;
4845
}
49-
50-
@Override
51-
public boolean value() {
52-
return value;
53-
}
54-
55-
public void value(boolean value) {
56-
this.value = value;
57-
}
58-
59-
6046
}

hibernate-core/src/main/java/org/hibernate/boot/models/categorize/internal/EntityTypeMetadataImpl.java

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -404,19 +404,10 @@ private int determineBatchSize() {
404404
}
405405

406406
private boolean decodeDynamicInsert() {
407-
final DynamicInsert dynamicInsertAnnotation = getClassDetails().getDirectAnnotationUsage( DynamicInsert.class );
408-
if ( dynamicInsertAnnotation == null ) {
409-
return false;
410-
}
411-
412-
return dynamicInsertAnnotation.value();
407+
return getClassDetails().getDirectAnnotationUsage( DynamicInsert.class ) != null;
413408
}
414409

415410
private boolean decodeDynamicUpdate() {
416-
final DynamicUpdate dynamicUpdateAnnotation = getClassDetails().getDirectAnnotationUsage( DynamicUpdate.class );
417-
if ( dynamicUpdateAnnotation == null ) {
418-
return false;
419-
}
420-
return dynamicUpdateAnnotation.value();
411+
return getClassDetails().getDirectAnnotationUsage( DynamicUpdate.class ) != null;
421412
}
422413
}

migration-guide.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ String isDefault();
151151
* Removed `@SelectBeforeUpdate`
152152
* Removed `org.hibernate.Session#delete(Object object)` and `org.hibernate.Session#delete(String entityName, Object object)` in favor of `org.hibernate.Session#remove(Object object)`
153153
* Removed `org.hibernate.annotations.CascadeType.DELETE` in favor of `org.hibernate.annotations.CascadeType#REMOVE`
154-
154+
* Removed the attribute value from `@DynamicInsert` and `@DynamicUpdate`
155155

156156
[WARNING]
157157
===

0 commit comments

Comments
 (0)