<commit_before>/*		
 * Copyright 2013-4-28 The EGF Co., Ltd. 
 * site: http://www.egfit.com
 * file: $Id: org.eclipse.jdt.ui.prefs,DatabaseService.java,fangj Exp$
 * created at:下午12:42:36
 */
package com.egf.db.services;

import java.sql.SQLException;

import com.egf.db.core.CreateTableCallback;
import com.egf.db.core.define.ColumnType;
import com.egf.db.core.define.IndexType;
import com.egf.db.core.define.column.ColumnDefine;
import com.egf.db.core.define.column.Comment;
import com.egf.db.core.define.column.Default;
import com.egf.db.core.define.column.NullOrNotNull;
import com.egf.db.core.define.name.ColumnName;
import com.egf.db.core.define.name.IndexName;
import com.egf.db.core.define.name.TableName;

/**
 * 数据库服务接口
 * @author fangj
 * @version $Revision: 2.0 $
 * @since 1.0
 */
public interface DatabaseService {
	
	public void createTable(TableName tableName,Comment comment, CreateTableCallback callback) throws SQLException;
	
	public void createTable(TableName tableName, CreateTableCallback callback) throws SQLException;
	
	/**
	 * 添加列
	 * @param tableName 表名
	 * @param columnName 列名
	 * @param columnType 列类型
	 * @throws SQLException 
	 */
	public void addColumn(TableName tableName,ColumnName columnName ,ColumnType columnType) throws SQLException;
	
	/**
	 * 添加列
	 * @param tableName 表名
	 * @param columnName 列名
	 * @param columnType 列类型
	 * @param define 列定义(Default,NullOrNotNull,Comment)
	 * @throws SQLException
	 */
	public void addColumn(TableName tableName,ColumnName columnName,ColumnType columnType,ColumnDefine  ... define) throws SQLException;
	
	/**
	 *  添加列
	 * @param tableName 表名
	 * @param columnName 列名
	 * @param columnType  列类型
	 * @param deft	默认值
	 * @throws SQLException
	 */
	public void addColumn(TableName tableName,ColumnName columnName ,ColumnType columnType,Default deft) throws SQLException;
	
	/**
	 * 添加列
	 * @param tableName 表名
	 * @param columnName 列名
	 * @param columnType 列类型
	 * @param nullOrNotNull 是否可为空
	 * @throws SQLException
	 */
	public void addColumn(TableName tableName,ColumnName columnName ,ColumnType columnType,NullOrNotNull nullOrNotNull) throws SQLException;
	
	/**
	 *  添加列
	 * @param tableName 表名
	 * @param columnName 列名
	 * @param columnType 列类型
	 * @param deft 默认值
	 * @param nullOrNotNull 是否可为空
	 * @throws SQLException
	 */
	public void addColumn(TableName tableName,ColumnName columnName ,ColumnType columnType,Default deft,NullOrNotNull nullOrNotNull) throws SQLException;
	
	/**
	 *  添加列
	 * @param tableName 表名
	 * @param columnName 列名
	 * @param columnType 列类型
	 * @param comment 注释
	 * @throws SQLException
	 */
	public void addColumn(TableName tableName,ColumnName columnName ,ColumnType columnType,Comment comment)throws SQLException;
	
	/**
	 * 添加列
	 * @param tableName 表名
	 * @param columnName 列名
	 * @param columnType 列类型
	 * @param deft 默认值
	 * @param comment 注释
	 * @throws SQLException
	 */
	public void addColumn(TableName tableName,ColumnName columnName ,ColumnType columnType,Default deft,Comment comment) throws SQLException;
	
	/**
	 * 添加列
	 * @param tableName 表名
	 * @param columnName 列名
	 * @param columnType 列类型
	 * @param nullOrNotNull 是否可为空
	 * @param comment 注释
	 * @throws SQLException
	 */
	public void addColumn(TableName tableName,ColumnName columnName ,ColumnType columnType,NullOrNotNull nullOrNotNull,Comment comment)throws SQLException;
	
	/**
	 * 添加列
	 * @param tableName 表名
	 * @param columnName 列名
	 * @param columnType 列类型
	 * @param deft 默认值
	 * @param nullOrNotNull 是否可为空
	 * @param comment 注释
	 * @throws SQLException
	 */
	public void addColumn(TableName tableName,ColumnName columnName ,ColumnType columnType,Default deft,NullOrNotNull nullOrNotNull,Comment comment) throws SQLException;
	
	public void addComment(TableName tableName,ColumnName columnName,Comment comment) throws SQLException;
	
	public void addColumnNotNull(TableName tableName,ColumnName columnName) throws SQLException;
	
	public void addColumnNull(TableName tableName,ColumnName columnName) throws SQLException;
	
	public void updateComment(TableName tableName,ColumnName columnName,Comment comment) throws SQLException;
	
	public void addDefault(TableName tableName,ColumnName columnName,Default deft) throws SQLException;
	
	public void updateDefault(TableName tableName,ColumnName columnName,Default deft) throws SQLException;
	
	public void addIndex(TableName tableName,IndexName indexName, ColumnName ... columnName) throws SQLException;
	
	public void addIndex(TableName tableName,IndexName indexName,IndexType indexType, ColumnName ...columnName) throws SQLException;
	
	public void addPrimaryKey(String name,TableName tableName,ColumnName ... columnName) throws SQLException;
	
	public void addForeignKey(String name,TableName tableName,ColumnName ... columnName) throws SQLException;
	
	public void addUnique(String name,TableName tableName,ColumnName ... columnName) throws SQLException;
	
	public void dropTable(String name) throws SQLException;
	
	public void dropIndex(String name) throws SQLException;
	
	/**
	 * 删除列
	 * @param tableName 表名
	 * @param columnName 列名
	 * @throws SQLException
	 */
	public void dropColumn(TableName tableName,ColumnName columnName) throws SQLException;
	
	public void dropPrimaryKey(TableName tableName,String name) throws SQLException;
	
	public void dropForeignKey(TableName tableName,String name) throws SQLException;
	
	public void dropUnique(TableName tableName,String name) throws SQLException;

	
}<commit_msg>增加了注释<commit_after>/*		
 * Copyright 2013-4-28 The EGF Co., Ltd. 
 * site: http://www.egfit.com
 * file: $Id: org.eclipse.jdt.ui.prefs,DatabaseService.java,fangj Exp$
 * created at:下午12:42:36
 */
package com.egf.db.services;

import java.sql.SQLException;

import com.egf.db.core.CreateTableCallback;
import com.egf.db.core.define.ColumnType;
import com.egf.db.core.define.IndexType;
import com.egf.db.core.define.column.ColumnDefine;
import com.egf.db.core.define.column.Comment;
import com.egf.db.core.define.column.Default;
import com.egf.db.core.define.column.NullOrNotNull;
import com.egf.db.core.define.name.ColumnName;
import com.egf.db.core.define.name.IndexName;
import com.egf.db.core.define.name.TableName;

/**
 * 数据库服务接口
 * @author fangj
 * @version $Revision: 2.0 $
 * @since 1.0
 */
public interface DatabaseService {
	
	public void createTable(TableName tableName,Comment comment, CreateTableCallback callback) throws SQLException;
	
	public void createTable(TableName tableName, CreateTableCallback callback) throws SQLException;
	
	/**
	 * 添加列
	 * @param tableName 表名
	 * @param columnName 列名
	 * @param columnType 列类型
	 * @throws SQLException 
	 */
	public void addColumn(TableName tableName,ColumnName columnName ,ColumnType columnType) throws SQLException;
	
	/**
	 * 添加列
	 * @param tableName 表名
	 * @param columnName 列名
	 * @param columnType 列类型
	 * @param define 列定义(Default,NullOrNotNull,Comment)
	 * @throws SQLException
	 */
	public void addColumn(TableName tableName,ColumnName columnName,ColumnType columnType,ColumnDefine  ... define) throws SQLException;
	
	/**
	 *  添加列
	 * @param tableName 表名
	 * @param columnName 列名
	 * @param columnType  列类型
	 * @param deft	默认值
	 * @throws SQLException
	 */
	public void addColumn(TableName tableName,ColumnName columnName ,ColumnType columnType,Default deft) throws SQLException;
	
	/**
	 * 添加列
	 * @param tableName 表名
	 * @param columnName 列名
	 * @param columnType 列类型
	 * @param nullOrNotNull 是否可为空
	 * @throws SQLException
	 */
	public void addColumn(TableName tableName,ColumnName columnName ,ColumnType columnType,NullOrNotNull nullOrNotNull) throws SQLException;
	
	/**
	 *  添加列
	 * @param tableName 表名
	 * @param columnName 列名
	 * @param columnType 列类型
	 * @param deft 默认值
	 * @param nullOrNotNull 是否可为空
	 * @throws SQLException
	 */
	public void addColumn(TableName tableName,ColumnName columnName ,ColumnType columnType,Default deft,NullOrNotNull nullOrNotNull) throws SQLException;
	
	/**
	 *  添加列
	 * @param tableName 表名
	 * @param columnName 列名
	 * @param columnType 列类型
	 * @param comment 注释
	 * @throws SQLException
	 */
	public void addColumn(TableName tableName,ColumnName columnName ,ColumnType columnType,Comment comment)throws SQLException;
	
	/**
	 * 添加列
	 * @param tableName 表名
	 * @param columnName 列名
	 * @param columnType 列类型
	 * @param deft 默认值
	 * @param comment 注释
	 * @throws SQLException
	 */
	public void addColumn(TableName tableName,ColumnName columnName ,ColumnType columnType,Default deft,Comment comment) throws SQLException;
	
	/**
	 * 添加列
	 * @param tableName 表名
	 * @param columnName 列名
	 * @param columnType 列类型
	 * @param nullOrNotNull 是否可为空
	 * @param comment 注释
	 * @throws SQLException
	 */
	public void addColumn(TableName tableName,ColumnName columnName ,ColumnType columnType,NullOrNotNull nullOrNotNull,Comment comment)throws SQLException;
	
	/**
	 * 添加列
	 * @param tableName 表名
	 * @param columnName 列名
	 * @param columnType 列类型
	 * @param deft 默认值
	 * @param nullOrNotNull 是否可为空
	 * @param comment 注释
	 * @throws SQLException
	 */
	public void addColumn(TableName tableName,ColumnName columnName ,ColumnType columnType,Default deft,NullOrNotNull nullOrNotNull,Comment comment) throws SQLException;
	
	public void addComment(TableName tableName,ColumnName columnName,Comment comment) throws SQLException;
	
	public void addColumnNotNull(TableName tableName,ColumnName columnName) throws SQLException;
	
	public void addColumnNull(TableName tableName,ColumnName columnName) throws SQLException;
	
	public void updateComment(TableName tableName,ColumnName columnName,Comment comment) throws SQLException;
	
	public void addDefault(TableName tableName,ColumnName columnName,Default deft) throws SQLException;
	
	public void updateDefault(TableName tableName,ColumnName columnName,Default deft) throws SQLException;
	
	/**
	 * 添加索引
	 * @param tableName 表名
	 * @param indexName 索引名称
	 * @param columnName 列名
	 * @throws SQLException
	 */
	public void addIndex(TableName tableName,IndexName indexName, ColumnName ... columnName) throws SQLException;
	
	/**
	 * 添加索引
	 * @param tableName 表名
	 * @param indexName 索引名称
	 * @param indexType 索引类型
	 * @param columnName 列名
	 * @throws SQLException
	 */
	public void addIndex(TableName tableName,IndexName indexName,IndexType indexType, ColumnName ...columnName) throws SQLException;
	
	public void addPrimaryKey(String name,TableName tableName,ColumnName ... columnName) throws SQLException;
	
	public void addForeignKey(String name,TableName tableName,ColumnName ... columnName) throws SQLException;
	
	public void addUnique(String name,TableName tableName,ColumnName ... columnName) throws SQLException;
	
	public void dropTable(String name) throws SQLException;
	
	/**
	 * 删除索引
	 * @param name 索引名称
	 * @throws SQLException
	 */
	public void dropIndex(String name) throws SQLException;
	
	/**
	 * 删除列
	 * @param tableName 表名
	 * @param columnName 列名
	 * @throws SQLException
	 */
	public void dropColumn(TableName tableName,ColumnName columnName) throws SQLException;
	
	public void dropPrimaryKey(TableName tableName,String name) throws SQLException;
	
	public void dropForeignKey(TableName tableName,String name) throws SQLException;
	
	public void dropUnique(TableName tableName,String name) throws SQLException;

	
}
{'fraction_non_alphanumeric': 0.08489810447628371, 'fraction_numerical': 0.0030257186081694403, 'mean_word_length': 4.777892030848329, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3135191', 'n_tokens_mistral': 3707, 'n_tokens_neox': 3469, 'n_words': 919}