|
6 | 6 | */ |
7 | 7 | package org.hibernate.type.descriptor; |
8 | 8 |
|
9 | | -import java.sql.Timestamp; |
10 | | -import java.util.Calendar; |
11 | | -import java.util.TimeZone; |
12 | | - |
13 | 9 | import org.hibernate.engine.jdbc.LobCreator; |
14 | 10 | import org.hibernate.engine.spi.SessionFactoryImplementor; |
15 | 11 | import org.hibernate.engine.spi.SharedSessionContractImplementor; |
16 | 12 |
|
| 13 | +import java.util.TimeZone; |
| 14 | + |
17 | 15 | /** |
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. |
19 | 19 | * |
20 | 20 | * @author Steve Ebersole |
| 21 | + * |
| 22 | + * @see ValueBinder |
| 23 | + * @see ValueExtractor |
21 | 24 | */ |
22 | 25 | public interface WrapperOptions { |
23 | 26 |
|
24 | 27 | /** |
25 | | - * Access to the current Session |
| 28 | + * Access to the current session. |
26 | 29 | */ |
27 | 30 | SharedSessionContractImplementor getSession(); |
28 | 31 |
|
29 | 32 | /** |
30 | | - * Access to the current Session |
| 33 | + * Access to the current session factory. |
31 | 34 | */ |
32 | 35 | SessionFactoryImplementor getSessionFactory(); |
33 | 36 |
|
34 | 37 | /** |
35 | | - * Should streams be used for binding LOB values. |
| 38 | + * Determines whether streams should be used for binding LOB values. |
36 | 39 | * |
37 | 40 | * @return {@code true}/{@code false} |
| 41 | + * |
| 42 | + * @see org.hibernate.dialect.Dialect#useInputStreamToInsertBlob() |
38 | 43 | */ |
39 | 44 | boolean useStreamForLobBinding(); |
40 | 45 |
|
41 | 46 | /** |
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() |
43 | 51 | */ |
44 | 52 | int getPreferredSqlTypeCodeForBoolean(); |
45 | 53 |
|
46 | 54 | /** |
47 | | - * Obtain access to the {@link LobCreator} |
| 55 | + * Obtain access to the {@link LobCreator}. |
48 | 56 | * |
49 | 57 | * @return The LOB creator |
| 58 | + * |
| 59 | + * @see org.hibernate.cfg.AvailableSettings#NON_CONTEXTUAL_LOB_CREATION |
| 60 | + * @see org.hibernate.dialect.Dialect#getDefaultNonContextualLobCreation() |
50 | 61 | */ |
51 | 62 | LobCreator getLobCreator(); |
52 | 63 |
|
53 | 64 | /** |
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()}. |
56 | 81 | * |
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 |
58 | 83 | * |
59 | | - * @return JDBC {@link TimeZone} |
| 84 | + * @see org.hibernate.cfg.AvailableSettings#JDBC_TIME_ZONE |
60 | 85 | */ |
61 | 86 | TimeZone getJdbcTimeZone(); |
62 | 87 | } |
0 commit comments