List of usage examples for org.joda.time TimeOfDay TimeOfDay
TimeOfDay(TimeOfDay partial, Chronology chrono)
From source file:com.moss.jodapersist.StringTimeOfDayUserType.java
License:Open Source License
public Object nullSafeGet(ResultSet resultSet, String[] names, Object arg2) throws HibernateException, SQLException { Calendar calendar = new GregorianCalendar(timeZone); String time = resultSet.getString(names[0]); if (time == null) return null; String[] pieces = time.split(":"); if (pieces.length != 2) throw new HibernateException("Invalid format (should be hh:mm) \"" + time + "\""); return new TimeOfDay(Integer.parseInt(pieces[0]), Integer.parseInt(pieces[1])); }
From source file:org.jadira.usertype.dateandtime.joda.columnmapper.LongColumnTimeOfDayMapper.java
License:Apache License
@Override public TimeOfDay fromNonNullValue(Long value) { return new TimeOfDay(value / 1000000L, ISOChronology.getInstance(DateTimeZone.UTC)); }