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

interface charcoal_ISQLBuilder
{

	/*
	 * SQLビルダ名を取得
	 */
	public function getSQLBuilderName();

	/**
	 *  SQLビルダを初期化
	 */
	public function init( charcoal_Config $config );

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

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

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

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

	/*
	 *	SQL作成(max)
	 */
	public  function buildMaxSQL( charcoal_ITableModel $model, $field_name, charcoal_SQLCriteria $criteria = NULL );

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

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

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

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