From: <one...@us...> - 2002-11-27 13:47:38
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/type In directory sc8-pr-cvs1:/tmp/cvs-serv24254/cirrus/hibernate/type Modified Files: CalendarDateType.java CalendarType.java Log Message: correctly propagate exceptions via proxies fixed uncompilable calendar types for JDK1.2 added --format and --delimiter options to SchemaExport Index: CalendarDateType.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/type/CalendarDateType.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CalendarDateType.java 26 Nov 2002 03:35:45 -0000 1.2 --- CalendarDateType.java 27 Nov 2002 13:47:34 -0000 1.3 *************** *** 22,28 **** public Object get(ResultSet rs, String name) throws HibernateException, SQLException { ! Calendar cal = new GregorianCalendar(); ! cal.setTimeInMillis( rs.getDate(name).getTime() ); ! return cal; } --- 22,36 ---- public Object get(ResultSet rs, String name) throws HibernateException, SQLException { ! ! Date date = rs.getDate(name); ! if (date!=null) { ! Calendar cal = new GregorianCalendar(); ! cal.setTime(date); ! return cal; ! } ! else { ! return null; ! } ! } *************** *** 33,37 **** throws HibernateException, SQLException { ! st.setDate( index, new Date( ( (Calendar) value ).getTimeInMillis() ) ); } --- 41,45 ---- throws HibernateException, SQLException { ! st.setDate( index, new Date( ( (Calendar) value ).getTime().getTime() ) ); } Index: CalendarType.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/type/CalendarType.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** CalendarType.java 26 Nov 2002 03:35:45 -0000 1.3 --- CalendarType.java 27 Nov 2002 13:47:34 -0000 1.4 *************** *** 26,30 **** if (ts!=null) { Calendar cal = new GregorianCalendar(); ! cal.setTimeInMillis( ts.getTime() ); return cal; } --- 26,30 ---- if (ts!=null) { Calendar cal = new GregorianCalendar(); ! cal.setTime(ts); return cal; } *************** *** 41,45 **** throws HibernateException, SQLException { ! st.setTimestamp( index, new Timestamp( ( (Calendar) value ).getTimeInMillis() ) ); } --- 41,45 ---- throws HibernateException, SQLException { ! st.setTimestamp( index, new Timestamp( ( (Calendar) value ).getTime().getTime() ) ); } |