Skip to content

Commit 71fe3ec

Browse files
committed
remove a deprecated operation
1 parent 0e5f623 commit 71fe3ec

File tree

2 files changed

+11
-23
lines changed

2 files changed

+11
-23
lines changed

hibernate-core/src/main/java/org/hibernate/boot/model/source/internal/hbm/ModelBinder.java

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import org.hibernate.AssertionFailure;
1818
import org.hibernate.FetchMode;
1919
import org.hibernate.annotations.CascadeType;
20+
import org.hibernate.annotations.OnDeleteAction;
2021
import org.hibernate.annotations.SourceType;
2122
import org.hibernate.boot.MappingException;
2223
import org.hibernate.boot.jaxb.Origin;
@@ -562,7 +563,7 @@ private void bindJoinedSubclassEntity(
562563
keyBinding.makeNationalized();
563564
}
564565
entityDescriptor.setKey( keyBinding );
565-
keyBinding.setCascadeDeleteEnabled( entitySource.isCascadeDeleteEnabled() );
566+
keyBinding.setOnDeleteAction( getOnDeleteAction( entitySource.isCascadeDeleteEnabled() ) );
566567
relationalObjectBinder.bindColumns(
567568
mappingDocument,
568569
entitySource.getPrimaryKeyColumnSources(),
@@ -593,7 +594,6 @@ public Identifier determineImplicitName(LocalMetadataBuildingContext context) {
593594

594595
bindJoinedSubclassEntities( entitySource, entityDescriptor );
595596
}
596-
597597
private void bindUnionSubclassEntities(
598598
EntitySource entitySource,
599599
PersistentClass superEntityDescriptor) {
@@ -1622,7 +1622,7 @@ private void bindSecondaryTable(
16221622
}
16231623
secondaryTableJoin.setKey( keyBinding );
16241624

1625-
keyBinding.setCascadeDeleteEnabled( secondaryTableSource.isCascadeDeleteEnabled() );
1625+
keyBinding.setOnDeleteAction( getOnDeleteAction( secondaryTableSource.isCascadeDeleteEnabled() ) );
16261626

16271627
// NOTE : no Type info to bind...
16281628

@@ -1972,7 +1972,7 @@ public void bindOneToOne(
19721972
setForeignKeyName( oneToOneBinding, oneToOneSource.getExplicitForeignKeyName() );
19731973
}
19741974

1975-
oneToOneBinding.setCascadeDeleteEnabled( oneToOneSource.isCascadeDeleteEnabled() );
1975+
oneToOneBinding.setOnDeleteAction( getOnDeleteAction( oneToOneSource.isCascadeDeleteEnabled() ) );
19761976
}
19771977

19781978
private Property createManyToOneAttribute(
@@ -2121,7 +2121,7 @@ private void bindManyToOneAttribute(
21212121
}
21222122
}
21232123

2124-
manyToOneBinding.setCascadeDeleteEnabled( manyToOneSource.isCascadeDeleteEnabled() );
2124+
manyToOneBinding.setOnDeleteAction( getOnDeleteAction( manyToOneSource.isCascadeDeleteEnabled() ) );
21252125
}
21262126

21272127
private static void setForeignKeyName(SimpleValue manyToOneBinding, String foreignKeyName) {
@@ -3203,8 +3203,8 @@ protected void bindCollectionKey() {
32033203
keyVal
32043204
);
32053205
setForeignKeyName( key, keySource.getExplicitForeignKeyName() );
3206-
key.setCascadeDeleteEnabled( getPluralAttributeSource().getKeySource().isCascadeDeleteEnabled() );
3207-
//
3206+
key.setOnDeleteAction( getOnDeleteAction( getPluralAttributeSource().getKeySource().isCascadeDeleteEnabled() ) );
3207+
32083208
// final ImplicitJoinColumnNameSource.Nature implicitNamingNature;
32093209
// if ( getPluralAttributeSource().getElementSource() instanceof PluralAttributeElementSourceManyToMany
32103210
// || getPluralAttributeSource().getElementSource() instanceof PluralAttributeElementSourceOneToMany ) {
@@ -4069,4 +4069,8 @@ private String columns(Value value) {
40694069
}
40704070
return builder.toString();
40714071
}
4072+
4073+
private static OnDeleteAction getOnDeleteAction(boolean entitySource) {
4074+
return entitySource ? OnDeleteAction.CASCADE : OnDeleteAction.NO_ACTION;
4075+
}
40724076
}

hibernate-core/src/main/java/org/hibernate/mapping/SimpleValue.java

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@
3535
import org.hibernate.dialect.Dialect;
3636
import org.hibernate.generator.Generator;
3737
import org.hibernate.generator.GeneratorCreationContext;
38-
import org.hibernate.internal.CoreLogging;
39-
import org.hibernate.internal.CoreMessageLogger;
4038
import org.hibernate.models.spi.MemberDetails;
4139
import org.hibernate.models.spi.TypeDetails;
4240
import org.hibernate.resource.beans.spi.ManagedBeanRegistry;
@@ -72,7 +70,6 @@
7270
* @author Yanming Zhou
7371
*/
7472
public abstract class SimpleValue implements KeyValue {
75-
private static final CoreMessageLogger log = CoreLogging.messageLogger( SimpleValue.class );
7673

7774
@Deprecated(since = "7.0", forRemoval = true)
7875
public static final String DEFAULT_ID_GEN_STRATEGY = ASSIGNED_GENERATOR_NAME;
@@ -171,24 +168,11 @@ public OnDeleteAction getOnDeleteAction() {
171168
return onDeleteAction;
172169
}
173170

174-
/**
175-
* @deprecated use {@link #getOnDeleteAction()}
176-
*/
177-
@Deprecated(since = "6.2")
178171
@Override
179172
public boolean isCascadeDeleteEnabled() {
180173
return onDeleteAction == OnDeleteAction.CASCADE;
181174
}
182175

183-
/**
184-
* @deprecated use {@link #setOnDeleteAction(OnDeleteAction)}
185-
*/
186-
@Deprecated(since = "6.2")
187-
public void setCascadeDeleteEnabled(boolean cascadeDeleteEnabled) {
188-
this.onDeleteAction = cascadeDeleteEnabled ? OnDeleteAction.CASCADE : OnDeleteAction.NO_ACTION;
189-
}
190-
191-
192176
public void addColumn(Column column) {
193177
addColumn( column, true, true );
194178
}

0 commit comments

Comments
 (0)