mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-09 04:34:49 +00:00
more docs for type package
This commit is contained in:
parent
c829c84d55
commit
aef9d064db
@ -55,7 +55,8 @@
|
|||||||
* These two approaches cannot be used together. A {@code UserType} always takes precedence
|
* These two approaches cannot be used together. A {@code UserType} always takes precedence
|
||||||
* over the compositional approach.
|
* over the compositional approach.
|
||||||
* <p>
|
* <p>
|
||||||
* Please see the User Guide for a more in-depth discussion.
|
* Please see the <em>User Guide</em> or the package {@link org.hibernate.type} for a more
|
||||||
|
* in-depth discussion.
|
||||||
*
|
*
|
||||||
* <h2 id="basic-value-mapping">Dialect-specific native SQL</h2>
|
* <h2 id="basic-value-mapping">Dialect-specific native SQL</h2>
|
||||||
*
|
*
|
||||||
|
@ -6,14 +6,35 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A Hibernate {@link org.hibernate.type.Type} is a strategy for mapping
|
* A Hibernate {@link org.hibernate.type.Type} is a strategy for mapping a Java
|
||||||
* a Java property type to a JDBC type or types. In modern Hibernate,
|
* property type to a JDBC type or types. In modern Hibernate, {@code Type} itself
|
||||||
* {@code Type} itself is now of receding importance, and we prefer to
|
* is now of receding importance, and we prefer to work directly with the combination
|
||||||
* work directly with the combination of:
|
* of:
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li>a {@link org.hibernate.type.descriptor.java.JavaType}, with a
|
* <li>a {@link org.hibernate.type.descriptor.java.JavaType}, with
|
||||||
* <li>a {@link org.hibernate.type.descriptor.jdbc.JdbcType}.
|
* <li>a {@link org.hibernate.type.descriptor.jdbc.JdbcType}.
|
||||||
* </ul>
|
* </ul>
|
||||||
|
* <p>
|
||||||
|
* A {@code JdbcType} is able to read and write a single Java type to one, or
|
||||||
|
* sometimes several, {@linkplain org.hibernate.type.SqlTypes JDBC types}.
|
||||||
|
* <p>
|
||||||
|
* A {@code JavaType} is able to determine if an attribute of a given Java type is
|
||||||
|
* dirty, and then convert it to one of several other equivalent Java representations
|
||||||
|
* at the request of its partner {@code JdbcType}.
|
||||||
|
* <p>
|
||||||
|
* For example, if an entity attribute of Java type {@code BigInteger} is mapped to
|
||||||
|
* the JDBC type {@link java.sql.Types#VARCHAR}, the
|
||||||
|
* {@link org.hibernate.type.descriptor.jdbc.VarcharJdbcType} will ask its
|
||||||
|
* {@link org.hibernate.type.descriptor.java.BigIntegerJavaType} to convert instances
|
||||||
|
* of {@code BigInteger} to and from {@code String} when writing to and reading from
|
||||||
|
* JDBC statements and result sets.
|
||||||
|
* <p>
|
||||||
|
* This approach provides quite some flexibility in allowing a given Java type to
|
||||||
|
* map to a range of JDBC types. However, when the built-in conversions don't handle
|
||||||
|
* a particular mapping, a
|
||||||
|
* {@link org.hibernate.metamodel.model.convert.spi.BasicValueConverter} may assist
|
||||||
|
* in the conversion process. For example, a JPA
|
||||||
|
* {@link jakarta.persistence.AttributeConverter} might be provided.
|
||||||
*
|
*
|
||||||
* @see org.hibernate.type.Type
|
* @see org.hibernate.type.Type
|
||||||
* @see org.hibernate.type.SqlTypes
|
* @see org.hibernate.type.SqlTypes
|
||||||
|
Loading…
x
Reference in New Issue
Block a user