/*
 * This file is part of Relaxe.
 * Copyright (c) 2014 Topi Nieminen
 * Author: Topi Nieminen <topi.nieminen@gmail.com>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License version 3
 * as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 * or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU Affero General Public License for more details.
 * You should have received a copy of the GNU Affero General Public License
 * along with this program; if not, see http://www.gnu.org/licenses or write to
 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA, 02110-1301 USA.
 *
 * The interactive user interfaces in modified source and object code versions
 * of this program must display Appropriate Legal Notices, as required under
 * Section 5 of the GNU Affero General Public License.
 */
/**
 * 
 */
package com.appspot.relaxe;

import java.util.Date;
import java.sql.ResultSet;
import java.sql.SQLException;

import com.appspot.relaxe.types.TimestampType;
import com.appspot.relaxe.value.TimestampHolder;


public class TimestampExtractor
	extends ValueExtractor<Date, TimestampType, TimestampHolder>
{
	public TimestampExtractor(int column) {
		super(column);			
	}
	
	@Override
	public TimestampHolder extract(ResultSet rs) throws SQLException {
		Date date = rs.getDate(getColumn());
		return (date == null) ? TimestampHolder.NULL_HOLDER : new TimestampHolder(date);
	}
}
@@ -1164,16 +1164,43 @@
 ception;
+%0Aimport java.sql.Timestamp;
 %0A%0Aimport
@@ -1538,30 +1538,38 @@
 %7B%0A%09%09
-Date date = rs.getDate
+Timestamp ts = rs.getTimestamp
 (get
@@ -1589,20 +1589,18 @@
 return (
-date
+ts
  == null
@@ -1657,12 +1657,10 @@
 der(
-date
+ts
 );%0A%09

Fix timestamp extractor