Skip to content

Commit faabc4c

Browse files
committed
remove some obsolete and deprecated code
1 parent 2651227 commit faabc4c

File tree

10 files changed

+25
-163
lines changed

10 files changed

+25
-163
lines changed

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

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -171,17 +171,4 @@
171171
* @see Synchronize
172172
*/
173173
String[] querySpaces() default {};
174-
175-
/**
176-
* Is the {@linkplain #query() SQL query} a call to a stored procedure
177-
* or function?
178-
*
179-
* @deprecated Calling database procedures and functions through
180-
* {@link org.hibernate.query.NativeQuery} is no longer supported;
181-
* use {@link jakarta.persistence.NamedStoredProcedureQuery} instead.
182-
*
183-
* @see org.hibernate.jpa.HibernateHints#HINT_CALLABLE_FUNCTION
184-
*/
185-
@Deprecated(since = "6.0", forRemoval = true)
186-
boolean callable() default false;
187174
}

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

Lines changed: 7 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
import org.hibernate.boot.query.SqlResultSetMappingDescriptor;
3333
import org.hibernate.boot.spi.MetadataBuildingContext;
3434
import org.hibernate.internal.CoreMessageLogger;
35-
import org.hibernate.internal.log.DeprecationLogger;
3635
import org.hibernate.jpa.HibernateHints;
3736
import org.hibernate.jpa.internal.util.FlushModeTypeHelper;
3837
import org.hibernate.models.spi.AnnotationTarget;
@@ -49,7 +48,6 @@
4948
import java.util.List;
5049
import java.util.function.Supplier;
5150

52-
import static java.lang.Boolean.TRUE;
5351
import static org.hibernate.internal.CoreLogging.messageLogger;
5452
import static org.hibernate.internal.util.StringHelper.nullIfEmpty;
5553
import static org.hibernate.internal.util.collections.ArrayHelper.isEmpty;
@@ -234,28 +232,15 @@ public static void bindNativeQuery(
234232
final NamedNativeQueryDefinition.Builder<?> builder =
235233
createQueryDefinition( namedNativeQuery, registrationName, resultSetMappingName, resultClass,
236234
namedNativeQuery.timeout(), namedNativeQuery.fetchSize(), querySpaces, location );
237-
238-
if ( TRUE == namedNativeQuery.callable() ) {
239-
final NamedProcedureCallDefinition definition =
240-
createStoredProcedure( builder, context, () -> illegalCallSyntax( namedNativeQuery ) );
241-
context.getMetadataCollector().addNamedProcedureCallDefinition( definition );
242-
DeprecationLogger.DEPRECATION_LOGGER.warn(
243-
"Marking named native queries as callable is no longer supported; use '@jakarta.persistence.NamedStoredProcedureQuery' instead. Ignoring."
235+
final NamedNativeQueryDefinition<?> queryDefinition = builder.build();
236+
if ( LOG.isDebugEnabled() ) {
237+
LOG.debugf(
238+
"Binding named native query: %s => %s",
239+
queryDefinition.getRegistrationName(),
240+
queryDefinition.getSqlQueryString()
244241
);
245242
}
246-
else {
247-
final NamedNativeQueryDefinition<?> queryDefinition = builder.build();
248-
249-
if ( LOG.isDebugEnabled() ) {
250-
LOG.debugf(
251-
"Binding named native query: %s => %s",
252-
queryDefinition.getRegistrationName(),
253-
queryDefinition.getSqlQueryString()
254-
);
255-
}
256-
257-
context.getMetadataCollector().addNamedNativeQuery( queryDefinition );
258-
}
243+
context.getMetadataCollector().addNamedNativeQuery( queryDefinition );
259244
}
260245

261246
private static <T> NamedNativeQueryDefinition.Builder<T> createQueryDefinition(
@@ -553,9 +538,4 @@ private static int skipWhitespace(String sqlString, int i) {
553538
}
554539
return i;
555540
}
556-
557-
private static AnnotationException illegalCallSyntax(org.hibernate.annotations.NamedNativeQuery queryAnn) {
558-
return new AnnotationException( "Callable 'NamedNativeQuery' named '" + queryAnn.name()
559-
+ "' does not use the JDBC call syntax" );
560-
}
561541
}

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

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ public class NamedNativeQueryAnnotation implements NamedNativeQuery {
4242
CacheRetrieveMode cacheRetrieveMode;
4343
boolean readOnly;
4444
String[] querySpaces;
45-
boolean callable;
4645

4746
/**
4847
* Used in creating dynamic annotation instances (e.g. from XML)
@@ -61,7 +60,6 @@ public NamedNativeQueryAnnotation(SourceModelBuildingContext modelContext) {
6160
cacheRetrieveMode = CacheRetrieveMode.USE;
6261
readOnly = false;
6362
querySpaces = new String[0];
64-
callable = false;
6563
}
6664

6765
/**
@@ -87,7 +85,6 @@ public NamedNativeQueryAnnotation(NamedNativeQuery annotation, SourceModelBuildi
8785
}
8886
this.readOnly = annotation.readOnly();
8987
this.querySpaces = annotation.querySpaces();
90-
this.callable = annotation.callable();
9188
}
9289

9390
/**
@@ -109,7 +106,6 @@ public NamedNativeQueryAnnotation(Map<String, Object> attributeValues, SourceMod
109106
this.cacheRetrieveMode = (CacheRetrieveMode) attributeValues.get( "cacheRetrieveMode" );
110107
this.readOnly = (boolean) attributeValues.get( "readOnly" );
111108
this.querySpaces = (String[]) attributeValues.get( "querySpaces" );
112-
this.callable = (boolean) attributeValues.get( "callable" );
113109
}
114110

115111
@Override
@@ -259,15 +255,6 @@ public void querySpaces(String[] value) {
259255
this.querySpaces = value;
260256
}
261257

262-
@Override
263-
public boolean callable() {
264-
return callable;
265-
}
266-
267-
public void callable(boolean value) {
268-
this.callable = value;
269-
}
270-
271258
public void apply(JaxbNamedNativeQueryImpl jaxbNamedQuery, XmlDocumentContext xmlDocumentContext) {
272259
name( jaxbNamedQuery.getName() );
273260
query( jaxbNamedQuery.getQuery() );

hibernate-core/src/main/java/org/hibernate/engine/spi/LoadQueryInfluencers.java

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -133,22 +133,6 @@ public void setEnabledCascadingFetchProfile(CascadingFetchProfile enabledCascadi
133133
this.enabledCascadingFetchProfile = enabledCascadingFetchProfile;
134134
}
135135

136-
/**
137-
* @deprecated Use {@link #getEnabledCascadingFetchProfile} instead
138-
*/
139-
@Deprecated( since = "6.0" )
140-
public String getInternalFetchProfile() {
141-
return getEnabledCascadingFetchProfile().getLegacyName();
142-
}
143-
144-
/**
145-
* @deprecated Use {@link #setEnabledCascadingFetchProfile} instead
146-
*/
147-
@Deprecated( since = "6.0" )
148-
public void setInternalFetchProfile(String internalFetchProfile) {
149-
setEnabledCascadingFetchProfile( CascadingFetchProfile.fromLegacyName( internalFetchProfile ) );
150-
}
151-
152136

153137
// filter support ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
154138

hibernate-core/src/main/java/org/hibernate/exception/internal/StandardSQLExceptionConverter.java

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,9 @@
1010
import org.hibernate.exception.spi.SQLExceptionConverter;
1111

1212
import java.sql.SQLException;
13-
import java.util.ArrayList;
1413
import java.util.Arrays;
1514
import java.util.List;
1615

17-
import org.checkerframework.checker.nullness.qual.Nullable;
1816

1917
/**
2018
* A {@link SQLExceptionConverter} that delegates to a chain of
@@ -30,26 +28,6 @@ public StandardSQLExceptionConverter(SQLExceptionConversionDelegate... delegates
3028
this.delegates = Arrays.asList(delegates);
3129
}
3230

33-
/**
34-
* @deprecated use {@link #StandardSQLExceptionConverter(SQLExceptionConversionDelegate...)}
35-
*/
36-
@Deprecated(since = "6.0")
37-
public StandardSQLExceptionConverter() {
38-
delegates = new ArrayList<>();
39-
}
40-
41-
/**
42-
* Add a delegate.
43-
*
44-
* @deprecated use {@link #StandardSQLExceptionConverter(SQLExceptionConversionDelegate...)}
45-
*/
46-
@Deprecated(since = "6.0")
47-
public void addDelegate(@Nullable SQLExceptionConversionDelegate delegate) {
48-
if ( delegate != null ) {
49-
this.delegates.add( delegate );
50-
}
51-
}
52-
5331
@Override
5432
public JDBCException convert(SQLException sqlException, String message, String sql) {
5533
for ( SQLExceptionConversionDelegate delegate : delegates ) {

hibernate-core/src/main/java/org/hibernate/graph/GraphSemantic.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,4 @@ public static GraphSemantic fromHintName(String hintName) {
8787
);
8888
};
8989
}
90-
91-
/**
92-
* @deprecated Use {@link #fromHintName} instead
93-
*/
94-
@Deprecated(since = "6.0")
95-
public static GraphSemantic fromJpaHintName(String hintName) {
96-
return fromHintName( hintName );
97-
}
9890
}

hibernate-core/src/main/java/org/hibernate/id/UUIDGenerator.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@
2121

2222
/**
2323
* An {@link IdentifierGenerator} which generates {@link UUID} values using a pluggable
24-
* {@link UUIDGenerationStrategy generation strategy}. The values this generator can return
25-
* include {@link UUID}, {@link String} and byte[16]
24+
* {@linkplain UUIDGenerationStrategy generation strategy}. The values this generator
25+
* can return include {@link UUID}, {@link String} and {@code byte[16]}.
2626
* <p>
27-
* Supports 2 config parameters:<ul>
28-
* <li>{@link #UUID_GEN_STRATEGY} - names the {@link UUIDGenerationStrategy} instance to use</li>
29-
* <li>{@link #UUID_GEN_STRATEGY_CLASS} - names the {@link UUIDGenerationStrategy} class to use</li>
27+
* Accepts two configuration parameters:<ul>
28+
* <li>{@value #UUID_GEN_STRATEGY} - names the {@link UUIDGenerationStrategy} instance to use</li>
29+
* <li>{@value #UUID_GEN_STRATEGY_CLASS} - names the {@link UUIDGenerationStrategy} class to use</li>
3030
* </ul>
3131
* <p>
32-
* Currently, there are 2 standard implementations of {@link UUIDGenerationStrategy}:<ul>
32+
* There are two standard implementations of {@link UUIDGenerationStrategy}:<ul>
3333
* <li>{@link StandardRandomStrategy} (the default, if none specified)</li>
3434
* <li>{@link org.hibernate.id.uuid.CustomVersionOneStrategy}</li>
3535
* </ul>

hibernate-core/src/main/java/org/hibernate/id/uuid/UuidValueGenerator.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@
99
import org.hibernate.engine.spi.SharedSessionContractImplementor;
1010

1111
/**
12-
* Represents a specific algorithm for producing UUID values. Used in
13-
* conjunction with {@linkplain UuidGenerator} and
12+
* Represents a specific algorithm for producing UUID values.
13+
* <p>
14+
* Used in conjunction with {@link UuidGenerator} and
15+
* {@link org.hibernate.annotations.UuidGenerator @UuidGenerator}.
1416
*
1517
* @author Steve Ebersole
1618
*/

hibernate-core/src/main/java/org/hibernate/loader/ast/spi/CascadingFetchProfile.java

Lines changed: 8 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -6,47 +6,18 @@
66

77
import org.hibernate.engine.spi.CascadingAction;
88
import org.hibernate.engine.spi.CascadingActions;
9-
import org.hibernate.internal.util.StringHelper;
109

1110
/**
1211
* @author Steve Ebersole
1312
*/
1413
public enum CascadingFetchProfile {
15-
MERGE( "merge", CascadingActions.MERGE ),
16-
REFRESH( "refresh", CascadingActions.REFRESH );
17-
18-
private final String legacyName;
19-
private final CascadingAction cascadingAction;
20-
21-
CascadingFetchProfile(String legacyName, CascadingAction cascadingAction) {
22-
this.legacyName = legacyName;
23-
this.cascadingAction = cascadingAction;
24-
}
25-
26-
public String getLegacyName() {
27-
return legacyName;
28-
}
29-
30-
public CascadingAction getCascadingAction() {
31-
return cascadingAction;
32-
}
33-
34-
public static CascadingFetchProfile fromLegacyName(String legacyName) {
35-
if ( StringHelper.isEmpty( legacyName ) ) {
36-
return null;
37-
}
38-
39-
if ( MERGE.legacyName.equalsIgnoreCase( legacyName ) ) {
40-
return MERGE;
41-
}
42-
43-
if ( REFRESH.legacyName.equalsIgnoreCase( legacyName ) ) {
44-
return REFRESH;
45-
}
46-
47-
throw new IllegalArgumentException(
48-
"Passed name [" + legacyName + "] not recognized as a legacy internal fetch profile name; " +
49-
"supported values include: 'merge' and 'refresh'"
50-
);
14+
MERGE,
15+
REFRESH;
16+
17+
public CascadingAction<?> getCascadingAction() {
18+
return switch ( this ) {
19+
case MERGE -> CascadingActions.MERGE;
20+
case REFRESH -> CascadingActions.REFRESH;
21+
};
5122
}
5223
}

hibernate-core/src/main/java/org/hibernate/metamodel/model/domain/EmbeddedDomainType.java

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)