<?xml version="1.0" encoding="Windows-31J" ?>

<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">

<sqlMap namespace="livez">

	<typeAlias alias="Imode" type="jp.sourceforge.livez.dao.Imode" />

	<resultMap id="Imode" class="Imode">
		<result property="name"				column="name" />
		<result property="productName"		column="product_name" />
		<result property="seriesName"		column="series_name" />
		<result property="html"				column="html" />
		<result property="xhtml"			column="xhtml" />
		<result property="browserColumn"	column="browser_column" />
		<result property="browserRow"		column="browser_row" />
		<result property="browserWidth"		column="browser_width" />
		<result property="browserHeight"	column="browser_height" />
		<result property="screenWidth"		column="screen_width" />
		<result property="screenHeight"		column="screen_height" />
		<result property="monochrome"		column="monochrome" />
		<result property="color"			column="color" />
		<result property="jpeg"				column="jpeg" />
		<result property="imotion"			column="imotion" />
		<result property="pdf"				column="pdf" />
		<result property="charaDen"         column="chara_den" />
		<result property="toruca"			column="toruca" />
		<result property="ichannel"			column="ichannel" />
		<result property="menuIcon"			column="menu_icon" />
		<result property="barcode"			column="barcode" />
		<result property="ssl"				column="ssl_type" />
	</resultMap>

	<cacheModel id="imode-cache" type="MEMORY">
		<flushInterval hours="1" />
		<flushOnExecute statement="livez.saveImode" />
		<flushOnExecute statement="livez.deleteImode" />
		<property name="reference-type" value="WEAK" />
	</cacheModel>

	<select id="listImode" resultMap="Imode" cacheModel="imode-cache">
		SELECT
			name, product_name, series_name,
			html, xhtml,
			browser_column, browser_row,
			browser_width, browser_height,
			screen_width, screen_height,
			monochrome, color, jpeg,
			imotion, pdf, chara_den, toruca, ichannel, menu_icon, barcode, ssl_type
		FROM imode
	</select>

	<select id="getImode" parameterClass="string" resultMap="Imode" cacheModel="imode-cache">
		SELECT
			name, product_name, series_name,
			html, xhtml,
			browser_column, browser_row,
			browser_width, browser_height,
			screen_width, screen_height,
			monochrome, color, jpeg,
			imotion, pdf, chara_den, toruca, ichannel, menu_icon, barcode, ssl_type
		FROM imode
		WHERE name = #value#
	</select>

	<insert id="saveImode" parameterClass="Imode">
		INSERT INTO imode (
			name, product_name, series_name,
			html, xhtml,
			browser_column, browser_row,
			browser_width, browser_height,
			screen_width, screen_height,
			monochrome, color, jpeg,
			imotion, pdf, chara_den, toruca, ichannel, menu_icon, barcode, ssl_type
		) VALUES (
			#name:VARCHAR#, #productName:VARCHAR#, #seriesName:VARCHAR#,
			#html:FLOAT#, #xhtml:FLOAT#,
			#browserColumn:NUMERIC#, #browserRow:NUMERIC#,
			#browserWidth:NUMERIC#, #browserHeight:NUMERIC#,
			#screenWidth:NUMERIC#, #screenHeight:NUMERIC#,
			#monochrome:BOOLEAN#, #color:NUMERIC#, #jpeg:BOOLEAN#,
			#imotion#, #pdf#, #charaDen#, #toruca#, #ichannel#, #menuIcon#, #barcode#, #ssl#
		)
	</insert>

	<delete id="deleteImode" parameterClass="string">
		DELETE FROM imode WHERE name = #value#
	</delete>



	<resultMap id="ImodeSubscreen" class="jp.sourceforge.livez.dao.ImodeSubscreen">
		<result property="name"		column="name" />
		<result property="width"	column="width" />
		<result property="height"	column="height" />
	</resultMap>

	<cacheModel id="imode_subscreen-cache" type="MEMORY">
		<flushInterval hours="1" />
	</cacheModel>

	<select id="getImodeSubscreen" parameterClass="string" resultMap="ImodeSubscreen" cacheModel="imode_subscreen-cache">
		SELECT name, width, height
		FROM imode_subscreen
		WHERE name = #value#
	</select>

	<resultMap id="ImodeIappli" class="jp.sourceforge.livez.dao.ImodeIappli">
		<result property="name"		column="name" />
		<result property="doja"		column="doja" />
		<result property="edition"	column="edition" />
		<result property="jar"		column="jar" />
		<result property="sp"		column="sp" />
		<result property="width"	column="width" />
		<result property="height"	column="height" />
		<result property="felica"	column="felica" />
	</resultMap>

	<cacheModel id="imode_iappli-cache" type="MEMORY">
		<flushInterval hours="1" />
	</cacheModel>

	<select id="getImodeIappli" parameterClass="string" resultMap="ImodeIappli" cacheModel="imode_iappli-cache">
		SELECT name, doja, edition, jar, sp, width, height, felica
		FROM imode_iappli
		WHERE name = #value#
	</select>

	<resultMap id="ImodeFlash" class="jp.sourceforge.livez.dao.ImodeFlash">
		<result property="name"			column="name" />
		<result property="version"		column="version" />
		<result property="screenHeight"	column="screen_height" />
		<result property="subscreen"	column="subscreen" />
	</resultMap>

	<cacheModel id="imode_flash-cache" type="MEMORY">
		<flushInterval hours="1" />
	</cacheModel>

	<select id="getImodeFlash" parameterClass="string" resultMap="ImodeFlash" cacheModel="imode_flash-cache">
		SELECT name, version, screen_height, subscreen
		FROM imode_flash
		WHERE name = #value#
	</select>

	<resultMap id="ImodeDecomail" class="jp.sourceforge.livez.dao.ImodeDecomail">
		<result property="name"			column="name" />
		<result property="version"		column="version" />
		<result property="template"		column="template" />
	</resultMap>

	<cacheModel id="imode_decomail-cache" type="MEMORY">
		<flushInterval hours="1" />
	</cacheModel>

	<select id="getImodeDecomail" parameterClass="string" resultMap="ImodeDecomail" cacheModel="imode_decomail-cache">
		SELECT name, version, template
		FROM imode_decomail
		WHERE name = #value#
	</select>

	<resultMap id="ImodeFrame" class="jp.sourceforge.livez.dao.ImodeFrame">
		<result property="name"		column="name" />
		<result property="width"	column="width" />
		<result property="height"	column="height" />
	</resultMap>

	<cacheModel id="imode_frame-cache" type="MEMORY">
		<flushInterval hours="1" />
	</cacheModel>

	<select id="getImodeFrame" parameterClass="string" resultMap="ImodeFrame" cacheModel="imode_frame-cache">
		SELECT name, width, height
		FROM imode_frame
		WHERE name = #value#
		ORDER BY width, height
	</select>

	<resultMap id="EZweb" class="jp.sourceforge.livez.dao.EZweb">
		<result property="deviceType"	column="device_type" />
		<result property="productName"	column="product_name" />
		<result property="seriesName"	column="series_name" />
		<result property="screenWidth"	column="screen_width" />
		<result property="screenHeight"	column="screen_height" />
		<result property="gif"			column="gif" />
		<result property="jpeg"			column="jpeg" />
		<result property="png8bit"		column="png_8bit" />
		<result property="bmp2bit"		column="bmp_2bit" />
		<result property="bmp1bit"		column="bmp_1bit" />
	</resultMap>

	<cacheModel id="ezweb-cache" type="MEMORY">
		<flushInterval hours="1" />
	</cacheModel>

	<select id="getEZweb" parameterClass="string" resultMap="EZweb" cacheModel="ezweb-cache">
		SELECT device_type, name, series_name, screen_width, screen_height
		FROM ezweb
		WHERE device_type = #value#
	</select>

	<resultMap id="EZwebFrame" class="jp.sourceforge.livez.dao.EZwebFrame">
		<result property="deviceType"	column="device_type" />
		<result property="width"		column="width" />
		<result property="height"		column="height" />
	</resultMap>

	<cacheModel id="ezweb_frame-cache" type="MEMORY">
		<flushInterval hours="1" />
	</cacheModel>

	<select id="getEZwebFrame" parameterClass="string" resultMap="EZwebFrame" cacheModel="ezweb_frame-cache">
		SELECT name, width, height
		FROM ezweb_frame
		WHERE device_type = #value#
		ORDER BY width, height
	</select>

	<resultMap id="EZwebStamp" class="jp.sourceforge.livez.dao.EZwebStamp">
		<result property="deviceType"	column="device_type" />
		<result property="width"		column="width" />
		<result property="height"		column="height" />
	</resultMap>

	<cacheModel id="ezweb_stamp-cache" type="MEMORY">
		<flushInterval hours="1" />
	</cacheModel>

	<select id="getEZwebStamp" parameterClass="string" resultMap="EZwebStamp" cacheModel="ezweb_stamp-cache">
		SELECT name, width, height
		FROM ezweb_stamp
		WHERE device_type = #value#
		ORDER BY width, height
	</select>

	<resultMap id="Vodafone" class="jp.sourceforge.livez.dao.Vodafone">
		<result property="name" column="name" />
		<result property="productName" column="product_name" />
	</resultMap>

	<cacheModel id="vodafone-cache" type="MEMORY">
		<flushInterval hours="1" />
	</cacheModel>

	<select id="getVodafone" parameterClass="string" resultMap="Vodafone" cacheModel="vodafone-cache">
		SELECT name, product_name
		FROM vodafone
		WHERE name = #value#
	</select>

</sqlMap>
