Java Code Examples for org.hibernate.cfg.Environment#jvmHasTimestampBug()
The following examples show how to use
org.hibernate.cfg.Environment#jvmHasTimestampBug() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CalendarType.java From cacheonix-core with GNU Lesser General Public License v2.1 | 6 votes |
public Object get(ResultSet rs, String name) throws HibernateException, SQLException { Timestamp ts = rs.getTimestamp(name); if (ts!=null) { Calendar cal = new GregorianCalendar(); if ( Environment.jvmHasTimestampBug() ) { cal.setTime( new Date( ts.getTime() + ts.getNanos() / 1000000 ) ); } else { cal.setTime(ts); } return cal; } else { return null; } }