Methods Summary |
---|
public int | compare(java.lang.Object x, java.lang.Object y, org.hibernate.EntityMode entityMode)
return CalendarComparator.INSTANCE.compare(x, y);
|
public java.lang.Object | deepCopyNotNull(java.lang.Object value)
return ( (Calendar) value ).clone();
|
public java.lang.Object | fromStringValue(java.lang.String xml)
Calendar result = new GregorianCalendar();
result.setTime( ( (java.util.Date) Hibernate.DATE.fromStringValue(xml) ) );
return result;
|
public java.lang.Object | get(java.sql.ResultSet rs, java.lang.String name)
Date date = rs.getDate(name);
if (date!=null) {
Calendar cal = new GregorianCalendar();
cal.setTime(date);
return cal;
}
else {
return null;
}
|
public int | getHashCode(java.lang.Object x, org.hibernate.EntityMode entityMode)
Calendar calendar = (Calendar) x;
int hashCode = 1;
hashCode = 31 * hashCode + calendar.get(Calendar.DAY_OF_MONTH);
hashCode = 31 * hashCode + calendar.get(Calendar.MONTH);
hashCode = 31 * hashCode + calendar.get(Calendar.YEAR);
return hashCode;
|
public java.lang.String | getName()
return "calendar_date";
|
public java.lang.Class | getReturnedClass()
return Calendar.class;
|
public boolean | isEqual(java.lang.Object x, java.lang.Object y)
if (x==y) return true;
if (x==null || y==null) return false;
Calendar calendar1 = (Calendar) x;
Calendar calendar2 = (Calendar) y;
return calendar1.get(Calendar.DAY_OF_MONTH) == calendar2.get(Calendar.DAY_OF_MONTH)
&& calendar1.get(Calendar.MONTH) == calendar2.get(Calendar.MONTH)
&& calendar1.get(Calendar.YEAR) == calendar2.get(Calendar.YEAR);
|
public void | set(java.sql.PreparedStatement st, java.lang.Object value, int index)
final Calendar cal = (Calendar) value;
//st.setDate( index, new Date( cal.getTimeInMillis() ), cal ); //JDK 1.5 only
st.setDate( index, new Date( cal.getTime().getTime() ), cal );
|
public int | sqlType()
return Types.DATE;
|
public java.lang.String | toString(java.lang.Object value)
return Hibernate.DATE.toString( ( (Calendar) value ).getTime() );
|