assertEquals("UserInfo",sql.getResultClass());
}
/** 测试聚集函数colum名称自动转换,示例转换 count(*) => count, max(age) => max_age, sum(income) => sum_income */
public void test_intergate_function_name_convert() {
sql = new SqlFactory().parseSql("select count(*) cnt, count(username) count_username,max(password) max_password,min(password) min_password,avg(sex) avg_sex from user_info");
String msg = sql.getColumns().toString();
assertNotNull(msg,sql.getColumnByName("Cnt"));
assertNotNull(msg,sql.getColumnByName("count_username"));
assertNotNull(msg,sql.getColumnByName("max_password"));
assertNotNull(msg,sql.getColumnByName("min_password"));
assertNotNull(msg,sql.getColumnByName("avg_sex"));
//FIXME 试聚集函数colum名称自动转换,示例转换 count(*) => count, max(age) => max_age, sum(income) => sum_income
sql = new SqlFactory().parseSql("select count(*) cnt, count(username),max(password),min(password),avg(sex) from user_info");
msg = sql.getColumns().toString();
assertNotNull(msg,sql.getColumnByName("Cnt"));
// assertNotNull(msg,sql.getColumnByName("C2"));
// assertNotNull(msg,sql.getColumnByName("C3"));
// assertNotNull(msg,sql.getColumnByName("C4"));