/**
 * 
 */
package cn.org.zeronote.orm.dao.dialect;

import java.util.HashMap;
import java.util.Map;

import cn.org.zeronote.orm.dao.SelectKey;

/**
 * 数据库适配
 * @author <a href='mailto:lizheng8318@gmail.com'>lizheng</a>
 *
 */
public class SqlRepairer {

	/**
	 * 数据库类型
	 * @author <a href='mailto:lizheng8318@gmail.com'>lizheng</a>
	 *
	 */
	public static enum DBType {
		MYSQL;
	}
	
	/**自增主键查询*/
	private static Map<DBType, SelectKey> selectKeyMap = new HashMap<DBType, SelectKey>();
	static {
		selectKeyMap.put(DBType.MYSQL, new SelectKey("ID", "SELECT @@IDENTITY AS ID"));
	}
	
	/**
	 * 
	 */
	public SqlRepairer() {
	}

	/**
	 * @return the selectKey
	 */
	public static SelectKey getSelectKey(DBType type) {
		return selectKeyMap.get(type);
	}
}

@@ -390,18 +390,68 @@
 pe %7B%0D%0A%09%09
-MY
+/** mysql */%0D%0A%09%09MYSQL,%0D%0A%09%09/** ms sql server */%0D%0A%09%09MS
 SQL;%0D%0A%09%7D
@@ -648,24 +648,107 @@
  AS ID%22));%0D%0A
+%09%09selectKeyMap.put(DBType.MSSQL, new SelectKey(%22ID%22, %22SELECT @@IDENTITY AS ID%22));%0D%0A
 %09%7D%0D%0A%09%0D%0A%09/**%0D

添加ms sql server方言支持