/*
 * 作成日: 2008/08/05
 * 著作権: Copyright (c) 2005 ZIGEN
 * ライセンス：Eclipse Public License - v 1.0
 * 原文：http://www.eclipse.org/legal/epl-v10.html
 */

package zigen.plugin.db.ext.s2jdbc.dto.rule;

import java.sql.Types;

import zigen.plugin.db.core.TableColumn;

public class OracleDtoMappingFactory extends DefaultDtoMappingFactory {
	
	public String getJavaType(TableColumn column) {
		return getJavaType(column.getDataType());
	}
	
	public String getTemporalType(int type) {
		switch (type) {
			
			case Types.TIME:
				return "TemporalType.TIME"; //$NON-NLS-1$
				
			case Types.DATE:
			case Types.TIMESTAMP:
				return "TemporalType.TIMESTAMP"; //$NON-NLS-1$
				
			default:
				return null;
		}
	}
	
	public String getJavaType(int type) {
		switch (type) {
			case Types.TIME:
				return "java.sql.Time"; //$NON-NLS-1$
				
			case Types.DATE:
			case Types.TIMESTAMP:
				return "java.util.Date"; //$NON-NLS-1$
				

			default:
				return super.getJavaType(type);
		}
	}
}