List of usage examples for org.hibernate.type TimeZoneType INSTANCE
TimeZoneType INSTANCE
To view the source code for org.hibernate.type TimeZoneType INSTANCE.
Click Source Link
From source file:org.unitedinternet.cosmo.hibernate.CalendarType.java
License:Apache License
@Override public Type[] getPropertyTypes() { return new Type[] { org.hibernate.type.CalendarType.INSTANCE, TimeZoneType.INSTANCE }; }
From source file:org.unitedinternet.cosmo.hibernate.CalendarType.java
License:Apache License
@Override public Object nullSafeGet(ResultSet rs, String[] names, SharedSessionContractImplementor session, Object owner) throws HibernateException, SQLException { TimeZone tz = (TimeZone) TimeZoneType.INSTANCE.nullSafeGet(rs, names[1], session); if (tz == null) { tz = TimeZone.getDefault(); }/* www.j a v a 2 s.c o m*/ Calendar cal = org.hibernate.type.CalendarType.INSTANCE.nullSafeGet(rs, names[0], session); cal.setTimeZone(tz); return cal; }
From source file:org.unitedinternet.cosmo.hibernate.CalendarType.java
License:Apache License
@Override public void nullSafeSet(PreparedStatement st, Object value, int index, SharedSessionContractImplementor session) throws HibernateException, SQLException { org.hibernate.type.CalendarType.INSTANCE.nullSafeSet(st, value, index, session); TimeZoneType.INSTANCE.nullSafeSet(st, value == null ? null : ((Calendar) value).getTimeZone(), index + 1, session);/*from w w w. j a v a 2 s.c o m*/ }