@Override public void initialize(UpdateTimestamp annotation, Class<?> propertyType) { if ( java.sql.Date.class.isAssignableFrom( propertyType ) ) { generator = new TimestampGenerators.CurrentSqlDateGenerator(); } else if ( Time.class.isAssignableFrom( propertyType ) ) { generator = new TimestampGenerators.CurrentSqlTimeGenerator(); } else if ( Timestamp.class.isAssignableFrom( propertyType ) ) { generator = new TimestampGenerators.CurrentSqlTimestampGenerator(); } else if ( Date.class.isAssignableFrom( propertyType ) ) { generator = new TimestampGenerators.CurrentDateGenerator(); } else if ( Calendar.class.isAssignableFrom( propertyType ) ) { generator = new TimestampGenerators.CurrentCalendarGenerator(); } else { throw new HibernateException( "Unsupported property type for generator annotation @UpdateTimestamp" ); } }