minor changes to javadoc
add javadoc to Dialect.resolveSqlTypeCode()
This commit is contained in:
parent
fafd894f3b
commit
a11ebdeefc
|
@ -91,7 +91,7 @@ public @interface Table {
|
||||||
* would not all be null, and will always use an outer join to read the columns. Thus,
|
* would not all be null, and will always use an outer join to read the columns. Thus,
|
||||||
* by default, Hibernate avoids creating a row of null values.
|
* by default, Hibernate avoids creating a row of null values.
|
||||||
* <p>
|
* <p>
|
||||||
* <em>Only applies to secondary tables.<p></em>
|
* <em>Only applies to secondary tables.</em>
|
||||||
*/
|
*/
|
||||||
boolean optional() default true;
|
boolean optional() default true;
|
||||||
|
|
||||||
|
|
|
@ -230,8 +230,9 @@ import static org.hibernate.type.descriptor.DateTimeUtils.appendAsTimestampWithM
|
||||||
* <p>
|
* <p>
|
||||||
* Almost every subclass must, as a bare minimum, override at least:
|
* Almost every subclass must, as a bare minimum, override at least:
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li>{@link #registerColumnTypes(TypeContributions, ServiceRegistry)} to define a mapping from SQL
|
* <li>{@link #registerColumnTypes(TypeContributions, ServiceRegistry)}
|
||||||
* {@linkplain SqlTypes type codes} to database column types, and
|
* to define a mapping from SQL {@linkplain SqlTypes type codes} to
|
||||||
|
* database column types, and
|
||||||
* <li>{@link #initializeFunctionRegistry(QueryEngine)} to register
|
* <li>{@link #initializeFunctionRegistry(QueryEngine)} to register
|
||||||
* mappings for standard HQL functions with the
|
* mappings for standard HQL functions with the
|
||||||
* {@link org.hibernate.query.sqm.function.SqmFunctionRegistry}.
|
* {@link org.hibernate.query.sqm.function.SqmFunctionRegistry}.
|
||||||
|
@ -411,15 +412,18 @@ public abstract class Dialect implements ConversionContext {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The column type name for a given JDBC type code defined in {@link Types} or
|
* The database column type name for a given JDBC type code defined
|
||||||
* {@link SqlTypes}. This default implementation returns the ANSI-standard type
|
* in {@link Types} or {@link SqlTypes}. This default implementation
|
||||||
* name.
|
* returns the ANSI-standard type name.
|
||||||
* <p>
|
* <p>
|
||||||
* This method may be overridden by concrete {@code Dialect}s as an alternative
|
* This method may be overridden by concrete {@code Dialect}s as an
|
||||||
* to {@link #registerColumnTypes(TypeContributions, ServiceRegistry)} for simple registrations.
|
* alternative to
|
||||||
|
* {@link #registerColumnTypes(TypeContributions, ServiceRegistry)}
|
||||||
|
* for simple registrations.
|
||||||
*
|
*
|
||||||
* @param sqlTypeCode a SQL type code
|
* @param sqlTypeCode a SQL {@link SqlTypes type code}
|
||||||
* @return a column type name, with $l, $p, $s placeholders for length, precision, scale
|
* @return a column type name, with $l, $p, $s placeholders for
|
||||||
|
* length, precision, scale
|
||||||
*
|
*
|
||||||
* @see SqlTypes
|
* @see SqlTypes
|
||||||
*/
|
*/
|
||||||
|
@ -534,8 +538,9 @@ public abstract class Dialect implements ConversionContext {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Resolves the {@link SqlTypes} type code for the given column type name as reported by the database,
|
* Resolves the {@link SqlTypes} type code for the given column
|
||||||
* or <code>null</code> if it can't be resolved.
|
* type name as reported by the database, or <code>null</code>
|
||||||
|
* if it can't be resolved.
|
||||||
*/
|
*/
|
||||||
protected Integer resolveSqlTypeCode(String columnTypeName, TypeConfiguration typeConfiguration) {
|
protected Integer resolveSqlTypeCode(String columnTypeName, TypeConfiguration typeConfiguration) {
|
||||||
final int parenthesisIndex = columnTypeName.lastIndexOf( '(' );
|
final int parenthesisIndex = columnTypeName.lastIndexOf( '(' );
|
||||||
|
@ -550,13 +555,26 @@ public abstract class Dialect implements ConversionContext {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Resolves the {@link SqlTypes} type code for the given column type name as reported by the database
|
* Resolves the {@link SqlTypes} type code for the given column
|
||||||
* and the base type name (i.e. without precision/length and scale), or <code>null</code> if it can't be resolved.
|
* type name as reported by the database and the base type name
|
||||||
|
* (i.e. without precision, length and scale), or <code>null</code>
|
||||||
|
* if it can't be resolved.
|
||||||
*/
|
*/
|
||||||
protected Integer resolveSqlTypeCode(String typeName, String baseTypeName, TypeConfiguration typeConfiguration) {
|
protected Integer resolveSqlTypeCode(String typeName, String baseTypeName, TypeConfiguration typeConfiguration) {
|
||||||
return typeConfiguration.getDdlTypeRegistry().getSqlTypeCode( baseTypeName );
|
return typeConfiguration.getDdlTypeRegistry().getSqlTypeCode( baseTypeName );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Assigns an appropriate {@link JdbcType} to a column of a JDBC
|
||||||
|
* result set based on the column type name, JDBC type code,
|
||||||
|
* precision, and scale.
|
||||||
|
*
|
||||||
|
* @param columnTypeName the column type name
|
||||||
|
* @param jdbcTypeCode the {@link SqlTypes type code}
|
||||||
|
* @param precision the precision or 0
|
||||||
|
* @param scale the scale of 0
|
||||||
|
* @return an appropriate instance of {@link JdbcType}
|
||||||
|
*/
|
||||||
public JdbcType resolveSqlTypeDescriptor(
|
public JdbcType resolveSqlTypeDescriptor(
|
||||||
String columnTypeName,
|
String columnTypeName,
|
||||||
int jdbcTypeCode,
|
int jdbcTypeCode,
|
||||||
|
|
Loading…
Reference in New Issue