Methods Summary |
---|
public java.lang.Object | deepCopyNotNull(java.lang.Object value)
return new Time( ( (java.util.Date) value ).getTime() );
|
public java.lang.Object | fromStringValue(java.lang.String xml)
try {
return new SimpleDateFormat(TIME_FORMAT).parse(xml);
}
catch (ParseException pe) {
throw new HibernateException("could not parse XML", pe);
}
|
public java.lang.Object | get(java.sql.ResultSet rs, java.lang.String name)
return rs.getTime(name);
|
public int | getHashCode(java.lang.Object x, org.hibernate.EntityMode entityMode)
Calendar calendar = java.util.Calendar.getInstance();
calendar.setTime( (java.util.Date) x );
int hashCode = 1;
hashCode = 31 * hashCode + calendar.get(Calendar.HOUR_OF_DAY);
hashCode = 31 * hashCode + calendar.get(Calendar.MINUTE);
hashCode = 31 * hashCode + calendar.get(Calendar.SECOND);
hashCode = 31 * hashCode + calendar.get(Calendar.MILLISECOND);
return hashCode;
|
public java.lang.String | getName() return "time";
|
public java.lang.Class | getReturnedClass()
return java.util.Date.class;
|
public boolean | isEqual(java.lang.Object x, java.lang.Object y)
if (x==y) return true;
if (x==null || y==null) return false;
Date xdate = (Date) x;
Date ydate = (Date) y;
if ( xdate.getTime()==ydate.getTime() ) return true;
Calendar calendar1 = java.util.Calendar.getInstance();
Calendar calendar2 = java.util.Calendar.getInstance();
calendar1.setTime( xdate );
calendar2.setTime( ydate );
return calendar1.get(Calendar.HOUR_OF_DAY) == calendar2.get(Calendar.HOUR_OF_DAY)
&& calendar1.get(Calendar.MINUTE) == calendar2.get(Calendar.MINUTE)
&& calendar1.get(Calendar.SECOND) == calendar2.get(Calendar.SECOND)
&& calendar1.get(Calendar.MILLISECOND) == calendar2.get(Calendar.MILLISECOND);
|
public java.lang.String | objectToSQLString(java.lang.Object value, org.hibernate.dialect.Dialect dialect)
return '\'" + new Time( ( (java.util.Date) value ).getTime() ).toString() + '\'";
|
public void | set(java.sql.PreparedStatement st, java.lang.Object value, int index)
Time time;
if (value instanceof Time) {
time = (Time) value;
}
else {
time = new Time( ( (java.util.Date) value ).getTime() );
}
st.setTime(index, time);
|
public int | sqlType()
return Types.TIME;
|
public java.lang.String | toString(java.lang.Object val)
return new SimpleDateFormat(TIME_FORMAT).format( (java.util.Date) val );
|