Skip to content

Commit dbc7b23

Browse files
committed
extract an oft-repeated expression as a new method of JdbcTypeIndicators
write some Javadoc about types
1 parent 77a1be1 commit dbc7b23

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+488
-259
lines changed

hibernate-core/src/main/java/org/hibernate/dialect/PostgreSQLIntervalSecondJdbcType.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public int getDefaultSqlTypeCode() {
100100
public JdbcType resolveIndicatedType(JdbcTypeIndicators indicators, JavaType<?> domainJtd) {
101101
// The default scale is 9
102102
if ( indicators.getColumnScale() == JdbcTypeIndicators.NO_COLUMN_SCALE || indicators.getColumnScale() > 6 ) {
103-
return indicators.getTypeConfiguration().getJdbcTypeRegistry().getDescriptor( SqlTypes.NUMERIC );
103+
return indicators.getJdbcType( SqlTypes.NUMERIC );
104104
}
105105
return this;
106106
}

hibernate-core/src/main/java/org/hibernate/metamodel/spi/EntityRepresentationStrategy.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,6 @@ default JavaType<?> getLoadJavaType() {
4747
}
4848

4949
default void visitEntityNameResolvers(Consumer<EntityNameResolver> consumer) {
50-
// byt default do nothing
50+
// by default do nothing
5151
}
5252
}

hibernate-core/src/main/java/org/hibernate/type/AbstractStandardBasicType.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@
3232
import org.hibernate.type.descriptor.jdbc.JdbcType;
3333

3434
/**
35-
* Convenience base class for {@link BasicType} implementations
35+
* Convenience base class for {@link BasicType} implementations.
36+
* Packages a {@link JavaType} with a {@link JdbcType}.
3637
*
3738
* @author Steve Ebersole
3839
* @author Brett Meyer

hibernate-core/src/main/java/org/hibernate/type/AdjustableBasicType.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
import org.hibernate.type.descriptor.jdbc.JdbcTypeIndicators;
1313

1414
/**
15-
* Extension contract for BasicType implementations that understand how to
16-
* adjust themselves relative to where/how they are used (e.g. accounting
17-
* for LOB, nationalized, primitive/wrapper, etc).
15+
* Extension contract for {@link BasicType} implementations which understand how to
16+
* adjust themselves relative to where/how they're used by, for example, accounting
17+
* for LOB, nationalized, primitive/wrapper, etc.
1818
*/
1919
public interface AdjustableBasicType<J> extends BasicType<J> {
2020
/**

hibernate-core/src/main/java/org/hibernate/type/SqlTypes.java

Lines changed: 45 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,77 +41,87 @@ public class SqlTypes {
4141
* A type code representing the generic SQL type {@code TINYINT}.
4242
*
4343
* @see Types#TINYINT
44+
* @see org.hibernate.type.descriptor.jdbc.TinyIntJdbcType
4445
*/
4546
public final static int TINYINT = Types.TINYINT;
4647

4748
/**
4849
* A type code representing the generic SQL type {@code SMALLINT}.
4950
*
5051
* @see Types#SMALLINT
52+
* @see org.hibernate.type.descriptor.jdbc.SmallIntJdbcType
5153
*/
5254
public final static int SMALLINT = Types.SMALLINT;
5355

5456
/**
5557
* A type code representing the generic SQL type {@code INTEGER}.
5658
*
5759
* @see Types#INTEGER
60+
* @see org.hibernate.type.descriptor.jdbc.IntegerJdbcType
5861
*/
5962
public final static int INTEGER = Types.INTEGER;
6063

6164
/**
6265
* A type code representing the generic SQL type {@code BIGINT}.
6366
*
6467
* @see Types#BIGINT
68+
* @see org.hibernate.type.descriptor.jdbc.BigIntJdbcType
6569
*/
6670
public final static int BIGINT = Types.BIGINT;
6771

6872
/**
6973
* A type code representing the generic SQL type {@code FLOAT}.
7074
*
7175
* @see Types#FLOAT
76+
* @see org.hibernate.type.descriptor.jdbc.FloatJdbcType
7277
*/
7378
public final static int FLOAT = Types.FLOAT;
7479

7580
/**
7681
* A type code representing the generic SQL type {@code REAL}.
7782
*
7883
* @see Types#REAL
84+
* @see org.hibernate.type.descriptor.jdbc.RealJdbcType
7985
*/
8086
public final static int REAL = Types.REAL;
8187

82-
8388
/**
8489
* A type code representing the generic SQL type {@code DOUBLE}.
8590
*
8691
* @see Types#DOUBLE
92+
* @see org.hibernate.type.descriptor.jdbc.DoubleJdbcType
8793
*/
8894
public final static int DOUBLE = Types.DOUBLE;
8995

9096
/**
9197
* A type code representing the generic SQL type {@code NUMERIC}.
9298
*
9399
* @see Types#NUMERIC
100+
* @see org.hibernate.type.descriptor.jdbc.NumericJdbcType
94101
*/
95102
public final static int NUMERIC = Types.NUMERIC;
96103

97104
/**
98105
* A type code representing the generic SQL type {@code DECIMAL}.
99106
*
100107
* @see Types#DECIMAL
108+
* @see org.hibernate.type.descriptor.jdbc.DecimalJdbcType
101109
*/
102110
public final static int DECIMAL = Types.DECIMAL;
103111

104112
/**
105113
* A type code representing the generic SQL type {@code CHAR}.
106114
*
107115
* @see Types#CHAR
116+
* @see org.hibernate.type.descriptor.jdbc.CharJdbcType
108117
*/
109118
public final static int CHAR = Types.CHAR;
110119

111120
/**
112121
* A type code representing the generic SQL type {@code VARCHAR}.
113122
*
114123
* @see Types#VARCHAR
124+
* @see org.hibernate.type.descriptor.jdbc.VarcharJdbcType
115125
*/
116126
public final static int VARCHAR = Types.VARCHAR;
117127

@@ -124,6 +134,7 @@ public class SqlTypes {
124134
* @see org.hibernate.Length#LONG
125135
*
126136
* @see Types#LONGVARCHAR
137+
* @see org.hibernate.type.descriptor.jdbc.LongVarcharJdbcType
127138
*/
128139
public final static int LONGVARCHAR = Types.LONGVARCHAR;
129140

@@ -140,34 +151,39 @@ public class SqlTypes {
140151
* A type code representing the generic SQL type {@code DATE}.
141152
*
142153
* @see Types#DATE
154+
* @see org.hibernate.type.descriptor.jdbc.DateJdbcType
143155
*/
144156
public final static int DATE = Types.DATE;
145157

146158
/**
147159
* A type code representing the generic SQL type {@code TIME}.
148160
*
149161
* @see Types#TIME
162+
* @see org.hibernate.type.descriptor.jdbc.TimeJdbcType
150163
*/
151164
public final static int TIME = Types.TIME;
152165

153166
/**
154167
* A type code representing the generic SQL type {@code TIMESTAMP}.
155168
*
156169
* @see Types#TIMESTAMP
170+
* @see org.hibernate.type.descriptor.jdbc.TimestampJdbcType
157171
*/
158172
public final static int TIMESTAMP = Types.TIMESTAMP;
159173

160174
/**
161175
* A type code representing the generic SQL type {@code BINARY}.
162176
*
163177
* @see Types#BINARY
178+
* @see org.hibernate.type.descriptor.jdbc.BinaryJdbcType
164179
*/
165180
public final static int BINARY = Types.BINARY;
166181

167182
/**
168183
* A type code representing the generic SQL type {@code VARBINARY}.
169184
*
170185
* @see Types#VARBINARY
186+
* @see org.hibernate.type.descriptor.jdbc.VarbinaryJdbcType
171187
*/
172188
public final static int VARBINARY = Types.VARBINARY;
173189

@@ -180,6 +196,7 @@ public class SqlTypes {
180196
* @see org.hibernate.Length#LONG
181197
*
182198
* @see Types#LONGVARBINARY
199+
* @see org.hibernate.type.descriptor.jdbc.LongVarbinaryJdbcType
183200
*/
184201
public final static int LONGVARBINARY = Types.LONGVARBINARY;
185202

@@ -213,6 +230,7 @@ public class SqlTypes {
213230
* A type code representing the generic SQL type {@code JAVA_OBJECT}.
214231
*
215232
* @see Types#JAVA_OBJECT
233+
* @see org.hibernate.type.descriptor.jdbc.ObjectJdbcType
216234
*/
217235
public final static int JAVA_OBJECT = Types.JAVA_OBJECT;
218236

@@ -234,20 +252,23 @@ public class SqlTypes {
234252
* A type code representing the generic SQL type {@code ARRAY}.
235253
*
236254
* @see Types#ARRAY
255+
* @see org.hibernate.type.descriptor.jdbc.ArrayJdbcType
237256
*/
238257
public final static int ARRAY = Types.ARRAY;
239258

240259
/**
241260
* A type code representing the generic SQL type {@code BLOB}.
242261
*
243-
* @see Types#ARRAY
262+
* @see Types#BLOB
263+
* @see org.hibernate.type.descriptor.jdbc.BlobJdbcType
244264
*/
245265
public final static int BLOB = Types.BLOB;
246266

247267
/**
248268
* A type code representing the generic SQL type {@code CLOB}.
249269
*
250270
* @see Types#CLOB
271+
* @see org.hibernate.type.descriptor.jdbc.ClobJdbcType
251272
*/
252273
public final static int CLOB = Types.CLOB;
253274

@@ -269,6 +290,8 @@ public class SqlTypes {
269290
* A type code representing the generic SQL type {@code BOOLEAN}.
270291
*
271292
* @see Types#BOOLEAN
293+
* @see org.hibernate.cfg.AvailableSettings#PREFERRED_BOOLEAN_JDBC_TYPE
294+
* @see org.hibernate.type.descriptor.jdbc.BooleanJdbcType
272295
*/
273296
public final static int BOOLEAN = Types.BOOLEAN;
274297

@@ -283,13 +306,15 @@ public class SqlTypes {
283306
* A type code representing the generic SQL type {@code NCHAR}.
284307
*
285308
* @see Types#NCHAR
309+
* @see org.hibernate.type.descriptor.jdbc.NCharJdbcType
286310
*/
287311
public static final int NCHAR = Types.NCHAR;
288312

289313
/**
290314
* A type code representing the generic SQL type {@code NVARCHAR}.
291315
*
292316
* @see Types#NVARCHAR
317+
* @see org.hibernate.type.descriptor.jdbc.NVarcharJdbcType
293318
*/
294319
public static final int NVARCHAR = Types.NVARCHAR;
295320

@@ -302,6 +327,7 @@ public class SqlTypes {
302327
* @see org.hibernate.Length#LONG
303328
*
304329
* @see Types#LONGNVARCHAR
330+
* @see org.hibernate.type.descriptor.jdbc.LongNVarcharJdbcType
305331
*/
306332
public static final int LONGNVARCHAR = Types.LONGNVARCHAR;
307333

@@ -318,13 +344,15 @@ public class SqlTypes {
318344
* A type code representing the generic SQL type {@code NCLOB}.
319345
*
320346
* @see Types#NCLOB
347+
* @see org.hibernate.type.descriptor.jdbc.NClobJdbcType
321348
*/
322349
public static final int NCLOB = Types.NCLOB;
323350

324351
/**
325352
* A type code representing the generic SQL type {@code XML}.
326353
*
327354
* @see Types#SQLXML
355+
* @see org.hibernate.type.descriptor.jdbc.XmlJdbcType
328356
*/
329357
public static final int SQLXML = Types.SQLXML;
330358

@@ -348,6 +376,7 @@ public class SqlTypes {
348376
* {@code TIMESTAMP WITH TIMEZONE}.
349377
*
350378
* @see Types#TIMESTAMP_WITH_TIMEZONE
379+
* @see org.hibernate.type.descriptor.jdbc.TimestampWithTimeZoneJdbcType
351380
*/
352381
public static final int TIMESTAMP_WITH_TIMEZONE = Types.TIMESTAMP_WITH_TIMEZONE;
353382

@@ -357,17 +386,22 @@ public class SqlTypes {
357386
* A type code representing the generic SQL type {@code UUID}.
358387
*
359388
* @see org.hibernate.cfg.AvailableSettings#PREFERRED_UUID_JDBC_TYPE
389+
* @see org.hibernate.type.descriptor.jdbc.UUIDJdbcType
360390
*/
361391
public static final int UUID = 3000;
362392

363393
/**
364394
* A type code representing the generic SQL type {@code JSON}.
395+
*
396+
* @see org.hibernate.type.descriptor.jdbc.JsonJdbcType
365397
*/
366398
public static final int JSON = 3001;
367399

368400
/**
369401
* A type code representing the generic SQL type {@code INET} for IPv4
370402
* or IPv6 addresses.
403+
*
404+
* @see org.hibernate.dialect.PostgreSQLInetJdbcType
371405
*/
372406
public static final int INET = 3002;
373407

@@ -376,6 +410,11 @@ public class SqlTypes {
376410
* where the value is given in UTC, instead of in the system or
377411
* {@linkplain org.hibernate.cfg.AvailableSettings#JDBC_TIME_ZONE
378412
* JDBC} timezone.
413+
*
414+
* @see org.hibernate.cfg.AvailableSettings#PREFERRED_INSTANT_JDBC_TYPE
415+
* @see org.hibernate.type.descriptor.jdbc.InstantJdbcType
416+
* @see org.hibernate.type.descriptor.jdbc.InstantAsTimestampJdbcType
417+
* @see org.hibernate.type.descriptor.jdbc.InstantAsTimestampWithTimeZoneJdbcType
379418
*/
380419
public static final int TIMESTAMP_UTC = 3003;
381420

@@ -384,6 +423,10 @@ public class SqlTypes {
384423
/**
385424
* A type code representing the generic SQL type {@code INTERVAL SECOND}
386425
* for a temporal duration given terms of seconds and fractional seconds.
426+
*
427+
* @see org.hibernate.cfg.AvailableSettings#PREFERRED_DURATION_JDBC_TYPE
428+
* @see org.hibernate.dialect.PostgreSQLIntervalSecondJdbcType
429+
* @see org.hibernate.dialect.H2DurationIntervalSecondJdbcType
387430
*/
388431
public static final int INTERVAL_SECOND = 3100;
389432

0 commit comments

Comments
 (0)