let's not forget @Nationalized

This commit is contained in:
Gavin King 2022-01-24 15:58:32 +01:00
parent dc2e86d5c1
commit 451603e2f2
3 changed files with 15 additions and 7 deletions

View File

@ -21,18 +21,19 @@
* {@link Dialect#getNationalizationSupport() the SQL dialect}.
* <ul>
* <li>Some databases support storing nationalized data using their
* "normal" character data types
* ({@code CHAR, VARCHAR, LONGVARCHAR, CLOB}).
* "normal" character data types ({@code CHAR, VARCHAR, CLOB}).
* For these dialects, this annotation is effectively ignored.
* See {@link org.hibernate.dialect.NationalizationSupport#IMPLICIT}.
* <li>Other databases support storing nationalized data only via the
* specialized, standard SQL variants
* ({@code NCHAR, NVARCHAR, LONGNVARCHAR, NCLOB)}.
* specialized, standard SQL variants ({@code NCHAR, NVARCHAR, NCLOB)}.
* For these dialects, this annotation will adjust the JDBC type
* code to use the specialized variant.
* See {@link org.hibernate.dialect.NationalizationSupport#EXPLICIT}.
* </ul>
*
* @see org.hibernate.dialect.NationalizationSupport
* @see org.hibernate.cfg.AvailableSettings#USE_NATIONALIZED_CHARACTER_DATA
*
* @author Steve Ebersole
*/
@Target( { METHOD, FIELD } )

View File

@ -649,17 +649,23 @@ public interface AvailableSettings {
* {@link java.sql.PreparedStatement#setNString(int, String)}
* {@link java.sql.PreparedStatement#setNClob(int, java.sql.NClob)}
* to pass character data, and
* <li>when generating DDL, the schema export tool uses {@code nvarchar}
* and {@code nclob} as the generated column types when no column
* type is explicitly specified using
* <li>when generating DDL, the schema export tool uses {@code nchar},
* {@code nvarchar}, or {@code nclob} as the generated column
* type when no column type is explicitly specified using
* {@link jakarta.persistence.Column#columnDefinition()}.
* </ol>
* This setting is <em>disabled</em> by default, and so Unicode character data
* may not be persisted correctly for databases with explicit nationalization
* support.
* <p>
* This is a global setting applying to all mappings associated with a given
* {@link org.hibernate.SessionFactory}.
* The {@link org.hibernate.annotations.Nationalized} annotation may be used
* to selectively enable nationalized character support for specific columns.
*
* @see org.hibernate.boot.MetadataBuilder#enableGlobalNationalizedCharacterDataSupport(boolean)
* @see org.hibernate.dialect.NationalizationSupport
* @see org.hibernate.annotations.Nationalized
*/
String USE_NATIONALIZED_CHARACTER_DATA = "hibernate.use_nationalized_character_data";

View File

@ -13,6 +13,7 @@
* character data (Unicode).
*
* @see org.hibernate.cfg.AvailableSettings#USE_NATIONALIZED_CHARACTER_DATA
* @see org.hibernate.annotations.Nationalized
* @see Dialect#getNationalizationSupport()
*/
public enum NationalizationSupport {