List of usage examples for org.hibernate.cfg Environment jvmHasTimestampBug
@Deprecated public static boolean jvmHasTimestampBug()
From source file:org.osaf.cosmo.hibernate.CalendarType.java
License:Apache License
public Object nullSafeGet(ResultSet rs, String[] names, SessionImplementor session, Object owner) throws HibernateException, SQLException { TimeZone tz = (TimeZone) Hibernate.TIMEZONE.nullSafeGet(rs, names[1]); if (tz == null) tz = TimeZone.getDefault(); Calendar cal = new GregorianCalendar(tz); Timestamp ts = rs.getTimestamp(names[0], cal); if (ts != null) { if (Environment.jvmHasTimestampBug()) { cal.setTime(new Date(ts.getTime() + ts.getNanos() / 1000000)); } else {//from w ww. j a v a 2 s .c om cal.setTime(ts); } return cal; } else { return null; } }