com.github.andyshaox.jdbc.FindSql Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of GearEE Show documentation
Show all versions of GearEE Show documentation
Enhance and formating the coding of JDK
package com.github.andyshaox.jdbc;
import java.lang.reflect.Method;
import com.github.andyshao.reflect.ClassOperation;
/**
*
* Title:
* Descript:
* Copyright: Copryright(c) Mar 10, 2016
* Encoding:UNIX UTF-8
*
* @author Andy.Shao
*
*/
public class FindSql implements SqlAssembly {
@Override
public String assemble(Dao dao , Method method , Object... args) {
Sql sql = dao.getSqls().get(method);
if (sql.getSqlAssembly() != SqlAssembly.class) {
SqlAssembly sqlAssembly = ClassOperation.newInstance(sql.getSqlAssembly());
return sqlAssembly.assemble(dao , method , args);
}
return SqlAssembly.DEFAUL.assemble(dao , method , args);
}
}