List of usage examples for org.joda.time TimeOfDay getMinuteOfHour
public int getMinuteOfHour()
From source file:com.moss.jodapersist.AnsiTimeOfDay.java
License:Open Source License
public void nullSafeSet(PreparedStatement statement, Object value, int index) throws HibernateException, SQLException { if (value == null) { statement.setTimestamp(index, null); } else {// w w w . j ava 2 s .com TimeOfDay tmd = (TimeOfDay) value; long millisInZone = tmd.toDateTimeToday(DateTimeZone.forTimeZone(timeZone)).getMillis(); Timestamp timestamp = new Timestamp(millisInZone); Time time = new Time(tmd.getHourOfDay(), tmd.getMinuteOfHour(), tmd.getSecondOfMinute()); statement.setTime(index, time); } }
From source file:org.jadira.usertype.dateandtime.joda.columnmapper.TimeColumnTimeOfDayMapper.java
License:Apache License
@Override public Time toNonNullValue(TimeOfDay value) { DateTime zonedValue = new LocalDateTime(1970, 1, 1, value.getHourOfDay(), value.getMinuteOfHour(), value.getSecondOfMinute(), value.getMillisOfSecond(), value.getChronology()).toDateTime(); final Time time = new Time(zonedValue.getMillis()); return time;//from w w w . j a va 2 s . co m }
From source file:org.jadira.usertype.dateandtime.joda.columnmapper.TimestampColumnTimeOfDayMapper.java
License:Apache License
@Override public Timestamp toNonNullValue(TimeOfDay value) { DateTime zonedValue = new LocalDateTime(1970, 1, 1, value.getHourOfDay(), value.getMinuteOfHour(), value.getSecondOfMinute(), value.getMillisOfSecond(), value.getChronology()).toDateTime(); final Timestamp timestamp = new Timestamp(zonedValue.getMillis()); return timestamp; }