<?php
/**
* SQLビルダを定義するインタフェース
*
* PHP version 5
*
* @package    interfaces
* @author     stk2k <stk2k@sazysoft.com>
* @copyright  2008 stk2k, sazysoft
*/

interface ISQLBuilder extends IObject
{
	/**
	 *  SQLビルダを初期化
	 */
	public function init( Config $config );

	/*
	 *	SQL作成(SELECT)
	 */
	public  function buildSelectSQL( ITableModel $model, SQLCriteria $criteria = NULL );

	/*
	 *	SQL作成(UPDATE)
	 */
	public  function buildUpdateSQL( ITableModel $model, DTO $dto );

	/*
	 *	SQL作成(INSERT)
	 */
	public  function buildInsertSQL( ITableModel $model, DTO $dto );

	/*
	 *	SQL作成(count)
	 */
	public  function buildCountSQL( ITableModel $model, SQLCriteria $criteria = NULL );

	/*
	 *	SQL作成(max)
	 */
	public  function buildMaxSQL( ITableModel $model, String $field, SQLCriteria $criteria = NULL );

	/*
	 *	SQL作成(DELETE)
	 */
	public  function buildDeleteSQL( ITableModel $model, SQLCriteria $criteria = NULL );

	/*
	 *	SQL作成(LAST_INSERT_ID)
	 */
	public  function buildLastIdSQL();

	/*
	 *	SQL作成(CREATE DATABASE)
	 */
	public  function buildCreateDatabaseSQL( String $db_name, String $charset = NULL );

	/*
	 *	SQL作成(CREATE TABLE)
	 */
	public  function buildCreateTableSQL( ITableModel $model );
}

return __FILE__;