CHAPTER 5 Inheritance and custom types Table 5.2 (Domain and web hosting)

CHAPTER 5 Inheritance and custom types Table 5.2 Date and time types Mapping type Java type Standard SQL built-in type date java.util.Date or java.sql.Date DATE time java.util.Date or java.sql.Time TIME timestamp java.util.Date or java.sql.Timestamp TIMESTAMP calendar java.util.Calendar TIMESTAMP calendar_date java.util.Calendar DATE nanosecond information that may be present in the database. Hibernate can t just cut off this information. This can lead to problems if you try to compare your java.util.Date properties with the equals() method, because it isn t symmetric with the java.sql.Timestamp subclass equals() method. First, the right way (in any case) to compare two java.util.Date objects, which also works for any subclass, is aDate.getTime() > bDate.getTime() (for a greater-than comparison). Second, you can write a custom mapping type that cuts off the database nanosecond information and returns a java.util.Date in all cases. Currently (although this may change in the future), no such mapping type is built into Hibernate. Binary and large value mapping types Table 5.3 lists Hibernate types for handling binary data and large values. Note that only binary is supported as the type of an identifier property. If a property in your persistent Java class is of type byte[], Hibernate can map it to a VARBINARY column with the binary mapping type. (Note that the real SQL Table 5.3 Binary and large value types Mapping type Java type Standard SQL built-in type binary byte[] VARBINARY text java.lang.String CLOB clob java.sql.Clob CLOB blob java.sql.Blob BLOB serializable Any Java class that implements java.io.Serializable VARBINARY
In case you need affordable webhost to host your website, our recommendation is ecommerce web host services.