CHAPTER 5 Inheritance and custom types The string (Web server logs)
CHAPTER 5 Inheritance and custom types The string mapping type isn t the only one built into Hibernate. Hibernate comes with various mapping types that define default persistence strategies for primitive Java types and certain JDK classes. 5.2.2 Built-in mapping types Hibernate s built-in mapping types usually share the name of the Java type they map. However, there may be more than one Hibernate mapping type for a particular Java type. The built-in types may not be used to perform arbitrary conversions, such as mapping a VARCHAR database value to a Java Integer property value. You may define your own custom value types for this kind of conversation, as shown later in this chapter. We now discuss the basic, date and time, locator object, and various other built-in mapping types and show you what Java and SQL datatype they handle. Java primitive mapping types The basic mapping types in table 5.1 map Java primitive types (or their wrapper types) to appropriate built-in SQL standard types. Table 5.1 Primitive types Mapping type Java type Standard SQL built-in type integer intor java.lang.Integer INTEGER long long or java.lang.Long BIGINT short short or java.lang.Short SMALLINT float float or java.lang.Float FLOAT double double or java.lang.Double DOUBLE big_decimal java.math.BigDecimal NUMERIC character java.lang.String CHAR(1) string java.lang.String VARCHAR byte byte or java.lang.Byte TINYINT boolean boolean or java.lang.Boolean BIT yes_no boolean or java.lang.Boolean CHAR(1) (’Y’ or ‘N’) true_false boolean or java.lang.Boolean CHAR(1) (’T’ or ‘F’)
You need excellent and relaible webhost company to host your web applications? Then pay a visit to Inexpensive Web Hosting services.