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( ( (Date) Hibernate.TIMESTAMP.fromStringValue(xml) ) );
return result;
|
public java.lang.Object | get(java.sql.ResultSet rs, java.lang.String name)
Timestamp ts = rs.getTimestamp(name);
if (ts!=null) {
Calendar cal = new GregorianCalendar();
if ( Environment.jvmHasTimestampBug() ) {
cal.setTime( new Date( ts.getTime() + ts.getNanos() / 1000000 ) );
}
else {
cal.setTime(ts);
}
return cal;
}
else {
return null;
}
|
public java.util.Comparator | getComparator()
return CalendarComparator.INSTANCE;
|
public int | getHashCode(java.lang.Object x, org.hibernate.EntityMode entityMode)
Calendar calendar = (Calendar) x;
int hashCode = 1;
hashCode = 31 * hashCode + calendar.get(Calendar.MILLISECOND);
hashCode = 31 * hashCode + calendar.get(Calendar.SECOND);
hashCode = 31 * hashCode + calendar.get(Calendar.MINUTE);
hashCode = 31 * hashCode + calendar.get(Calendar.HOUR_OF_DAY);
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";
|
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.MILLISECOND) == calendar2.get(Calendar.MILLISECOND)
&& calendar1.get(Calendar.SECOND) == calendar2.get(Calendar.SECOND)
&& calendar1.get(Calendar.MINUTE) == calendar2.get(Calendar.MINUTE)
&& calendar1.get(Calendar.HOUR_OF_DAY) == calendar2.get(Calendar.HOUR_OF_DAY)
&& 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 java.lang.Object | next(java.lang.Object current, org.hibernate.engine.SessionImplementor session)
return seed( session );
|
public java.lang.Object | seed(org.hibernate.engine.SessionImplementor session)
return Calendar.getInstance();
|
public void | set(java.sql.PreparedStatement st, java.lang.Object value, int index)
final Calendar cal = (Calendar) value;
//st.setTimestamp( index, new Timestamp( cal.getTimeInMillis() ), cal ); //JDK 1.5 only
st.setTimestamp( index, new Timestamp( cal.getTime().getTime() ), cal );
|
public int | sqlType()
return Types.TIMESTAMP;
|
public java.lang.String | toString(java.lang.Object value)
return Hibernate.TIMESTAMP.toString( ( (Calendar) value ).getTime() );
|