Skip to content

Commit cf9578a

Browse files
committed
add some cross-refs to the Javadoc
so we can easily find where these settings ultimately come from
1 parent f58e450 commit cf9578a

File tree

4 files changed

+57
-18
lines changed

4 files changed

+57
-18
lines changed

hibernate-core/src/main/java/org/hibernate/type/descriptor/ValueBinder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import java.sql.SQLException;
1212

1313
/**
14-
* Contract for binding values to a {@link PreparedStatement}.
14+
* Contract for binding values to a JDBC {@link PreparedStatement}.
1515
*
1616
* @author Steve Ebersole
1717
*/

hibernate-core/src/main/java/org/hibernate/type/descriptor/ValueExtractor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
import java.sql.SQLException;
1212

1313
/**
14-
* Contract for extracting value via JDBC from {@link ResultSet} or as output
15-
* param from {@link CallableStatement}.
14+
* Contract for extracting values from a JDBC {@link ResultSet} or
15+
* from output the parameters of a {@link CallableStatement}.
1616
*
1717
* @author Steve Ebersole
1818
*/

hibernate-core/src/main/java/org/hibernate/type/descriptor/WrapperOptions.java

Lines changed: 39 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,57 +6,82 @@
66
*/
77
package org.hibernate.type.descriptor;
88

9-
import java.sql.Timestamp;
10-
import java.util.Calendar;
11-
import java.util.TimeZone;
12-
139
import org.hibernate.engine.jdbc.LobCreator;
1410
import org.hibernate.engine.spi.SessionFactoryImplementor;
1511
import org.hibernate.engine.spi.SharedSessionContractImplementor;
1612

13+
import java.util.TimeZone;
14+
1715
/**
18-
* Gives binding (nullSafeSet) and extracting (nullSafeGet) code access to options.
16+
* Options for {@linkplain ValueBinder#bind(java.sql.PreparedStatement, Object, int, WrapperOptions)
17+
* binding values to} and {@linkplain ValueExtractor#extract(java.sql.ResultSet, int, WrapperOptions)
18+
* extracting values from} JDBC prepared statements and result sets.
1919
*
2020
* @author Steve Ebersole
21+
*
22+
* @see ValueBinder
23+
* @see ValueExtractor
2124
*/
2225
public interface WrapperOptions {
2326

2427
/**
25-
* Access to the current Session
28+
* Access to the current session.
2629
*/
2730
SharedSessionContractImplementor getSession();
2831

2932
/**
30-
* Access to the current Session
33+
* Access to the current session factory.
3134
*/
3235
SessionFactoryImplementor getSessionFactory();
3336

3437
/**
35-
* Should streams be used for binding LOB values.
38+
* Determines whether streams should be used for binding LOB values.
3639
*
3740
* @return {@code true}/{@code false}
41+
*
42+
* @see org.hibernate.dialect.Dialect#useInputStreamToInsertBlob()
3843
*/
3944
boolean useStreamForLobBinding();
4045

4146
/**
42-
* Get the JDBC {@link java.sql.Types type code} used to bind a null boolean value
47+
* The JDBC {@link java.sql.Types type code} used to bind a null boolean value.
48+
*
49+
* @see org.hibernate.cfg.AvailableSettings#PREFERRED_BOOLEAN_JDBC_TYPE
50+
* @see org.hibernate.dialect.Dialect#getPreferredSqlTypeCodeForBoolean()
4351
*/
4452
int getPreferredSqlTypeCodeForBoolean();
4553

4654
/**
47-
* Obtain access to the {@link LobCreator}
55+
* Obtain access to the {@link LobCreator}.
4856
*
4957
* @return The LOB creator
58+
*
59+
* @see org.hibernate.cfg.AvailableSettings#NON_CONTEXTUAL_LOB_CREATION
60+
* @see org.hibernate.dialect.Dialect#getDefaultNonContextualLobCreation()
5061
*/
5162
LobCreator getLobCreator();
5263

5364
/**
54-
* The JDBC {@link TimeZone} used when persisting Timestamp and DateTime properties into the database.
55-
* This setting is used when storing timestamps using the {@link java.sql.PreparedStatement#setTimestamp(int, Timestamp, Calendar)} method.
65+
* The JDBC {@link TimeZone} used when writing a value of type {@link java.sql.Time}
66+
* or {@link java.sql.Timestamp} to a JDBC {@link java.sql.PreparedStatement}, or
67+
* when reading from a JDBC {@link java.sql.ResultSet}.
68+
* <ul>
69+
* <li>When {@code getJdbcTimeZone()} is null, the method
70+
* {@link java.sql.PreparedStatement#setTimestamp(int, java.sql.Timestamp)} is
71+
* called to write a timestamp, and
72+
* {@link java.sql.ResultSet#getTimestamp(int)} is called to read a timestamp.
73+
* <li>But when not null, the method
74+
* {@link java.sql.PreparedStatement#setTimestamp(int, java.sql.Timestamp, java.util.Calendar)}
75+
* is called to write a timestamp, and
76+
* {@link java.sql.ResultSet#getTimestamp(int, java.util.Calendar)} is called to
77+
* read a timestamp.
78+
</ul>
79+
* Thus, the storage {@link TimeZone} can differ from the default JVM TimeZone given
80+
* by {@link TimeZone#getDefault()}.
5681
*
57-
* This way, the storage {@link TimeZone} can differ from the default JVM TimeZone given by {@link TimeZone#getDefault()}.
82+
* @return the JDBC {@link TimeZone}, or null if no JDBC timezone was explicitly set
5883
*
59-
* @return JDBC {@link TimeZone}
84+
* @see org.hibernate.cfg.AvailableSettings#JDBC_TIME_ZONE
6085
*/
6186
TimeZone getJdbcTimeZone();
6287
}

hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/JdbcTypeIndicators.java

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import org.hibernate.type.spi.TypeConfiguration;
1616

1717
/**
18-
* A parameter object that helps in determine the {@link java.sql.Types SQL/JDBC type}
18+
* A parameter object that helps determine the {@link java.sql.Types SQL/JDBC type}
1919
* recommended by the JDBC spec (explicitly or implicitly) for a given Java type.
2020
*
2121
* @see BasicJavaType#getRecommendedJdbcType
@@ -67,6 +67,9 @@ default TemporalType getTemporalPrecision() {
6767
* When mapping a boolean type to the database what is the preferred SQL type code to use?
6868
* <p/>
6969
* Returns a key into the {@link JdbcTypeRegistry}.
70+
*
71+
* @see org.hibernate.cfg.AvailableSettings#PREFERRED_BOOLEAN_JDBC_TYPE
72+
* @see org.hibernate.dialect.Dialect#getPreferredSqlTypeCodeForBoolean()
7073
*/
7174
default int getPreferredSqlTypeCodeForBoolean() {
7275
return getCurrentBaseSqlTypeIndicators().getPreferredSqlTypeCodeForBoolean();
@@ -76,6 +79,8 @@ default int getPreferredSqlTypeCodeForBoolean() {
7679
* When mapping a duration type to the database what is the preferred SQL type code to use?
7780
* <p/>
7881
* Returns a key into the {@link JdbcTypeRegistry}.
82+
*
83+
* @see org.hibernate.cfg.AvailableSettings#PREFERRED_DURATION_JDBC_TYPE
7984
*/
8085
default int getPreferredSqlTypeCodeForDuration() {
8186
return getCurrentBaseSqlTypeIndicators().getPreferredSqlTypeCodeForDuration();
@@ -85,6 +90,8 @@ default int getPreferredSqlTypeCodeForDuration() {
8590
* When mapping an uuid type to the database what is the preferred SQL type code to use?
8691
* <p/>
8792
* Returns a key into the {@link JdbcTypeRegistry}.
93+
*
94+
* @see org.hibernate.cfg.AvailableSettings#PREFERRED_UUID_JDBC_TYPE
8895
*/
8996
default int getPreferredSqlTypeCodeForUuid() {
9097
return getCurrentBaseSqlTypeIndicators().getPreferredSqlTypeCodeForUuid();
@@ -94,6 +101,8 @@ default int getPreferredSqlTypeCodeForUuid() {
94101
* When mapping an instant type to the database what is the preferred SQL type code to use?
95102
* <p/>
96103
* Returns a key into the {@link JdbcTypeRegistry}.
104+
*
105+
* @see org.hibernate.cfg.AvailableSettings#PREFERRED_INSTANT_JDBC_TYPE
97106
*/
98107
default int getPreferredSqlTypeCodeForInstant() {
99108
return getCurrentBaseSqlTypeIndicators().getPreferredSqlTypeCodeForInstant();
@@ -104,6 +113,8 @@ default int getPreferredSqlTypeCodeForInstant() {
104113
* <p/>
105114
* Returns a key into the {@link JdbcTypeRegistry}.
106115
*
116+
* @see org.hibernate.dialect.Dialect#getPreferredSqlTypeCodeForArray()
117+
*
107118
* @since 6.1
108119
*/
109120
default int getPreferredSqlTypeCodeForArray() {
@@ -137,6 +148,9 @@ default int getColumnScale() {
137148

138149
/**
139150
* The default {@link TimeZoneStorageStrategy}.
151+
*
152+
* @see org.hibernate.cfg.AvailableSettings#TIMEZONE_DEFAULT_STORAGE
153+
* @see org.hibernate.dialect.Dialect#getTimeZoneSupport()
140154
*/
141155
default TimeZoneStorageStrategy getDefaultTimeZoneStorageStrategy() {
142156
return getCurrentBaseSqlTypeIndicators().getDefaultTimeZoneStorageStrategy();

0 commit comments

Comments
 (0)