Skip to content

Commit 7ad197e

Browse files
committed
Deprecate LobHandler and SqlXmlHandler abstractions
Including SqlLobValue and related support classes. Closes gh-32179
1 parent 7e67da8 commit 7ad197e

18 files changed

+65
-14
lines changed

spring-jdbc/src/main/java/org/springframework/jdbc/LobRetrievalFailureException.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2018 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -25,7 +25,9 @@
2525
*
2626
* @author Juergen Hoeller
2727
* @since 1.0.2
28+
* @deprecated as of 6.2 along with {@link org.springframework.jdbc.support.lob.LobHandler}
2829
*/
30+
@Deprecated(since = "6.2")
2931
@SuppressWarnings("serial")
3032
public class LobRetrievalFailureException extends DataRetrievalFailureException {
3133

spring-jdbc/src/main/java/org/springframework/jdbc/core/support/AbstractLobCreatingPreparedStatementCallback.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@
5151
* @author Juergen Hoeller
5252
* @since 1.0.2
5353
* @see org.springframework.jdbc.support.lob.LobCreator
54+
* @deprecated as of 6.2, in favor of {@link SqlBinaryValue} and {@link SqlCharacterValue}
5455
*/
56+
@Deprecated(since = "6.2")
5557
public abstract class AbstractLobCreatingPreparedStatementCallback implements PreparedStatementCallback<Integer> {
5658

5759
private final LobHandler lobHandler;

spring-jdbc/src/main/java/org/springframework/jdbc/core/support/AbstractLobStreamingResultSetExtractor.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,10 @@
5454
* @param <T> the result type
5555
* @see org.springframework.jdbc.support.lob.LobHandler
5656
* @see org.springframework.jdbc.LobRetrievalFailureException
57+
* @deprecated as of 6.2 along with {@link org.springframework.jdbc.support.lob.LobHandler},
58+
* in favor of {@link ResultSet#getBinaryStream}/{@link ResultSet#getCharacterStream} usage
5759
*/
60+
@Deprecated(since = "6.2")
5861
public abstract class AbstractLobStreamingResultSetExtractor<T> implements ResultSetExtractor<T> {
5962

6063
/**

spring-jdbc/src/main/java/org/springframework/jdbc/core/support/SqlLobValue.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,9 @@
6868
* @see org.springframework.jdbc.core.JdbcTemplate#update(String, Object[], int[])
6969
* @see org.springframework.jdbc.object.SqlUpdate#update(Object[])
7070
* @see org.springframework.jdbc.object.StoredProcedure#execute(java.util.Map)
71+
* @deprecated as of 6.2, in favor of {@link SqlBinaryValue} and {@link SqlCharacterValue}
7172
*/
73+
@Deprecated(since = "6.2")
7274
public class SqlLobValue implements DisposableSqlTypeValue {
7375

7476
@Nullable

spring-jdbc/src/main/java/org/springframework/jdbc/support/lob/AbstractLobHandler.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2013 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -32,7 +32,10 @@
3232
* @author Juergen Hoeller
3333
* @since 1.2
3434
* @see java.sql.ResultSet#findColumn
35+
* @deprecated as of 6.2, in favor of {@link org.springframework.jdbc.core.support.SqlBinaryValue}
36+
* and {@link org.springframework.jdbc.core.support.SqlCharacterValue}
3537
*/
38+
@Deprecated(since = "6.2")
3639
public abstract class AbstractLobHandler implements LobHandler {
3740

3841
@Override

spring-jdbc/src/main/java/org/springframework/jdbc/support/lob/DefaultLobHandler.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2017 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -80,7 +80,10 @@
8080
* @see java.sql.PreparedStatement#setString
8181
* @see java.sql.PreparedStatement#setAsciiStream
8282
* @see java.sql.PreparedStatement#setCharacterStream
83+
* @deprecated as of 6.2, in favor of {@link org.springframework.jdbc.core.support.SqlBinaryValue}
84+
* and {@link org.springframework.jdbc.core.support.SqlCharacterValue}
8385
*/
86+
@Deprecated(since = "6.2")
8487
public class DefaultLobHandler extends AbstractLobHandler {
8588

8689
protected final Log logger = LogFactory.getLog(getClass());

spring-jdbc/src/main/java/org/springframework/jdbc/support/lob/LobCreator.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2023 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -57,7 +57,10 @@
5757
* @see java.sql.PreparedStatement#setString
5858
* @see java.sql.PreparedStatement#setAsciiStream
5959
* @see java.sql.PreparedStatement#setCharacterStream
60+
* @deprecated as of 6.2, in favor of {@link org.springframework.jdbc.core.support.SqlBinaryValue}
61+
* and {@link org.springframework.jdbc.core.support.SqlCharacterValue}
6062
*/
63+
@Deprecated(since = "6.2")
6164
public interface LobCreator extends Closeable {
6265

6366
/**

spring-jdbc/src/main/java/org/springframework/jdbc/support/lob/LobHandler.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2016 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -72,7 +72,10 @@
7272
* @see java.sql.ResultSet#getString
7373
* @see java.sql.ResultSet#getAsciiStream
7474
* @see java.sql.ResultSet#getCharacterStream
75+
* @deprecated as of 6.2, in favor of {@link org.springframework.jdbc.core.support.SqlBinaryValue}
76+
* and {@link org.springframework.jdbc.core.support.SqlCharacterValue}
7577
*/
78+
@Deprecated(since = "6.2")
7679
public interface LobHandler {
7780

7881
/**

spring-jdbc/src/main/java/org/springframework/jdbc/support/lob/PassThroughBlob.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2022 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -31,6 +31,7 @@
3131
* @author Juergen Hoeller
3232
* @since 2.5.3
3333
*/
34+
@Deprecated
3435
class PassThroughBlob implements Blob {
3536

3637
@Nullable

spring-jdbc/src/main/java/org/springframework/jdbc/support/lob/PassThroughClob.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2022 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -38,6 +38,7 @@
3838
* @author Juergen Hoeller
3939
* @since 2.5.3
4040
*/
41+
@Deprecated
4142
class PassThroughClob implements Clob {
4243

4344
@Nullable

spring-jdbc/src/main/java/org/springframework/jdbc/support/lob/TemporaryLobCreator.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2023 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -46,7 +46,10 @@
4646
* @see DefaultLobHandler#setCreateTemporaryLob
4747
* @see java.sql.Connection#createBlob()
4848
* @see java.sql.Connection#createClob()
49+
* @deprecated as of 6.2, in favor of {@link org.springframework.jdbc.core.support.SqlBinaryValue}
50+
* and {@link org.springframework.jdbc.core.support.SqlCharacterValue}
4951
*/
52+
@Deprecated(since = "6.2")
5053
public class TemporaryLobCreator implements LobCreator {
5154

5255
protected static final Log logger = LogFactory.getLog(TemporaryLobCreator.class);

spring-jdbc/src/main/java/org/springframework/jdbc/support/xml/Jdbc4SqlXmlHandler.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2017 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -19,6 +19,7 @@
1919
import java.io.IOException;
2020
import java.io.InputStream;
2121
import java.io.Reader;
22+
import java.sql.Connection;
2223
import java.sql.PreparedStatement;
2324
import java.sql.ResultSet;
2425
import java.sql.SQLException;
@@ -46,7 +47,11 @@
4647
* @see java.sql.SQLXML
4748
* @see java.sql.ResultSet#getSQLXML
4849
* @see java.sql.PreparedStatement#setSQLXML
50+
* @deprecated as of 6.2, in favor of direct {@link ResultSet#getSQLXML} and
51+
* {@link Connection#createSQLXML()} usage, possibly in combination with a
52+
* custom {@link org.springframework.jdbc.support.SqlValue} implementation
4953
*/
54+
@Deprecated(since = "6.2")
5055
public class Jdbc4SqlXmlHandler implements SqlXmlHandler {
5156

5257
//-------------------------------------------------------------------------

spring-jdbc/src/main/java/org/springframework/jdbc/support/xml/SqlXmlFeatureNotImplementedException.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2012 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -16,6 +16,9 @@
1616

1717
package org.springframework.jdbc.support.xml;
1818

19+
import java.sql.Connection;
20+
import java.sql.ResultSet;
21+
1922
import org.springframework.dao.InvalidDataAccessApiUsageException;
2023

2124
/**
@@ -24,7 +27,11 @@
2427
*
2528
* @author Thomas Risberg
2629
* @since 2.5.5
30+
* @deprecated as of 6.2, in favor of direct {@link ResultSet#getSQLXML} and
31+
* {@link Connection#createSQLXML()} usage, possibly in combination with a
32+
* custom {@link org.springframework.jdbc.support.SqlValue} implementation
2733
*/
34+
@Deprecated(since = "6.2")
2835
@SuppressWarnings("serial")
2936
public class SqlXmlFeatureNotImplementedException extends InvalidDataAccessApiUsageException {
3037

spring-jdbc/src/main/java/org/springframework/jdbc/support/xml/SqlXmlHandler.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2018 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -18,6 +18,7 @@
1818

1919
import java.io.InputStream;
2020
import java.io.Reader;
21+
import java.sql.Connection;
2122
import java.sql.ResultSet;
2223
import java.sql.SQLException;
2324

@@ -45,7 +46,11 @@
4546
* @see java.sql.SQLXML
4647
* @see java.sql.ResultSet#getSQLXML
4748
* @see java.sql.PreparedStatement#setSQLXML
49+
* @deprecated as of 6.2, in favor of direct {@link ResultSet#getSQLXML} and
50+
* {@link Connection#createSQLXML()} usage, possibly in combination with a
51+
* custom {@link org.springframework.jdbc.support.SqlValue} implementation
4852
*/
53+
@Deprecated(since = "6.2")
4954
public interface SqlXmlHandler {
5055

5156
//-------------------------------------------------------------------------

spring-jdbc/src/main/java/org/springframework/jdbc/support/xml/SqlXmlValue.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@
2525
* @author Thomas Risberg
2626
* @since 2.5.5
2727
* @see org.springframework.jdbc.support.SqlValue
28+
* @deprecated as of 6.2, in favor of a direct {@link SqlValue} implementation
2829
*/
30+
@Deprecated(since = "6.2")
2931
public interface SqlXmlValue extends SqlValue {
3032

3133
}

spring-jdbc/src/main/java/org/springframework/jdbc/support/xml/XmlBinaryStreamProvider.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2012 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -26,7 +26,9 @@
2626
* @author Thomas Risberg
2727
* @since 2.5.5
2828
* @see java.io.OutputStream
29+
* @deprecated as of 6.2, in favor of direct {@link java.sql.SQLXML} usage
2930
*/
31+
@Deprecated(since = "6.2")
3032
public interface XmlBinaryStreamProvider {
3133

3234
/**

spring-jdbc/src/main/java/org/springframework/jdbc/support/xml/XmlCharacterStreamProvider.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2012 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -26,7 +26,9 @@
2626
* @author Thomas Risberg
2727
* @since 2.5.5
2828
* @see java.io.Writer
29+
* @deprecated as of 6.2, in favor of direct {@link java.sql.SQLXML} usage
2930
*/
31+
@Deprecated(since = "6.2")
3032
public interface XmlCharacterStreamProvider {
3133

3234
/**

spring-jdbc/src/main/java/org/springframework/jdbc/support/xml/XmlResultProvider.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2012 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -25,7 +25,9 @@
2525
* @author Thomas Risberg
2626
* @since 2.5.5
2727
* @see javax.xml.transform.Result
28+
* @deprecated as of 6.2, in favor of direct {@link java.sql.SQLXML} usage
2829
*/
30+
@Deprecated(since = "6.2")
2931
public interface XmlResultProvider {
3032

3133
/**

0 commit comments

Comments
 (0)