Skip to content

Commit a11ebde

Browse files
committed
minor changes to javadoc
add javadoc to Dialect.resolveSqlTypeCode()
1 parent fafd894 commit a11ebde

File tree

2 files changed

+32
-14
lines changed

2 files changed

+32
-14
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
* would not all be null, and will always use an outer join to read the columns. Thus,
9292
* by default, Hibernate avoids creating a row of null values.
9393
* <p>
94-
* <em>Only applies to secondary tables.<p></em>
94+
* <em>Only applies to secondary tables.</em>
9595
*/
9696
boolean optional() default true;
9797

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

Lines changed: 31 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,9 @@
230230
* <p>
231231
* Almost every subclass must, as a bare minimum, override at least:
232232
* <ul>
233-
* <li>{@link #registerColumnTypes(TypeContributions, ServiceRegistry)} to define a mapping from SQL
234-
* {@linkplain SqlTypes type codes} to database column types, and
233+
* <li>{@link #registerColumnTypes(TypeContributions, ServiceRegistry)}
234+
* to define a mapping from SQL {@linkplain SqlTypes type codes} to
235+
* database column types, and
235236
* <li>{@link #initializeFunctionRegistry(QueryEngine)} to register
236237
* mappings for standard HQL functions with the
237238
* {@link org.hibernate.query.sqm.function.SqmFunctionRegistry}.
@@ -411,15 +412,18 @@ private CapacityDependentDdlType.Builder sqlTypeBuilder(int sqlTypeCode, int big
411412
}
412413

413414
/**
414-
* The column type name for a given JDBC type code defined in {@link Types} or
415-
* {@link SqlTypes}. This default implementation returns the ANSI-standard type
416-
* name.
415+
* The database column type name for a given JDBC type code defined
416+
* in {@link Types} or {@link SqlTypes}. This default implementation
417+
* returns the ANSI-standard type name.
417418
* <p>
418-
* This method may be overridden by concrete {@code Dialect}s as an alternative
419-
* to {@link #registerColumnTypes(TypeContributions, ServiceRegistry)} for simple registrations.
419+
* This method may be overridden by concrete {@code Dialect}s as an
420+
* alternative to
421+
* {@link #registerColumnTypes(TypeContributions, ServiceRegistry)}
422+
* for simple registrations.
420423
*
421-
* @param sqlTypeCode a SQL type code
422-
* @return a column type name, with $l, $p, $s placeholders for length, precision, scale
424+
* @param sqlTypeCode a SQL {@link SqlTypes type code}
425+
* @return a column type name, with $l, $p, $s placeholders for
426+
* length, precision, scale
423427
*
424428
* @see SqlTypes
425429
*/
@@ -534,8 +538,9 @@ protected DatabaseVersion getMinimumSupportedVersion() {
534538
}
535539

536540
/**
537-
* Resolves the {@link SqlTypes} type code for the given column type name as reported by the database,
538-
* or <code>null</code> if it can't be resolved.
541+
* Resolves the {@link SqlTypes} type code for the given column
542+
* type name as reported by the database, or <code>null</code>
543+
* if it can't be resolved.
539544
*/
540545
protected Integer resolveSqlTypeCode(String columnTypeName, TypeConfiguration typeConfiguration) {
541546
final int parenthesisIndex = columnTypeName.lastIndexOf( '(' );
@@ -550,13 +555,26 @@ protected Integer resolveSqlTypeCode(String columnTypeName, TypeConfiguration ty
550555
}
551556

552557
/**
553-
* Resolves the {@link SqlTypes} type code for the given column type name as reported by the database
554-
* and the base type name (i.e. without precision/length and scale), or <code>null</code> if it can't be resolved.
558+
* Resolves the {@link SqlTypes} type code for the given column
559+
* type name as reported by the database and the base type name
560+
* (i.e. without precision, length and scale), or <code>null</code>
561+
* if it can't be resolved.
555562
*/
556563
protected Integer resolveSqlTypeCode(String typeName, String baseTypeName, TypeConfiguration typeConfiguration) {
557564
return typeConfiguration.getDdlTypeRegistry().getSqlTypeCode( baseTypeName );
558565
}
559566

567+
/**
568+
* Assigns an appropriate {@link JdbcType} to a column of a JDBC
569+
* result set based on the column type name, JDBC type code,
570+
* precision, and scale.
571+
*
572+
* @param columnTypeName the column type name
573+
* @param jdbcTypeCode the {@link SqlTypes type code}
574+
* @param precision the precision or 0
575+
* @param scale the scale of 0
576+
* @return an appropriate instance of {@link JdbcType}
577+
*/
560578
public JdbcType resolveSqlTypeDescriptor(
561579
String columnTypeName,
562580
int jdbcTypeCode,

0 commit comments

Comments
 (0)