Hibernate Mapping Types

In every hibernate mapping files, we used to denote the “type” of the mapping variable. This type is actually known as Hibernate mapping types.
These are very much different from SQL database types as well as Java data types. Here you can find a list of Hibernate mapping types. Source : here

integer, long, short

Java primitives or wrapper classes to appropriate (vendor-specific) SQL column types.

float, double

Java primitives or wrapper classes to appropriate (vendor-specific) SQL column types.

character, byte

Java primitives or wrapper classes to appropriate (vendor-specific) SQL column types.

boolean, yes_no, true_false

Alternative encodings for a Java boolean or java.lang.Boolean

string

java.lang.String to VARCHAR (or Oracle VARCHAR2).

date, time, timestamp

java.util.Date and its subclasses to SQL types DATE, TIME and TIMESTAMP (or equivalent).

calendar, calendar_date

java.util.Calendar to SQL types TIMESTAMP and DATE (or equivalent).

big_decimal, big_integer

java.math.BigDecimal and java.math.BigInteger to NUMERIC (or Oracle NUMBER).

locale, timezone, currency

java.util.Locale, java.util.TimeZone and java.util.Currency to VARCHAR (or Oracle VARCHAR2). Instances of Locale and Currency are mapped to their ISO codes. Instances of TimeZone are mapped to their ID

class

java.lang.Class to VARCHAR (or Oracle VARCHAR2). A Class is mapped to its fully qualified name.

binary

Maps byte arrays to an appropriate SQL binary type.

text

Maps long Java strings to a SQL CLOB or TEXT type.

serializable

Maps serializable Java types to an appropriate SQL binary type. You may also indicate the Hibernate type serializable with the name of a serializable Java class or interface that does not default to a basic type.

clob, blob

Type mappings for the JDBC classes java.sql.Clob and java.sql.BlobThese types may be inconvenient for some applications, since the blob or clob object may not be reused outside of a transaction. (Furthermore, driver support is patchy and inconsistent.)

Technorati: Hibernate

+