Search in sources :

Example 1 with VarsqlMethodNotFoundException

use of com.varsql.core.exception.VarsqlMethodNotFoundException in project varsql by varsqlinfo.

the class MetaControlBean method getDDLScript.

public <T> T getDDLScript(String dbObjType, DatabaseParamInfo paramInfo, DDLCreateOption ddlOption, String... objNm) {
    String callMethodName = String.format("get%ss", StringUtils.capitalize(dbObjType));
    try {
        if (VartechReflectionUtils.hasMethod(this.ddlScriptImpl.getClass(), callMethodName, DatabaseParamInfo.class, DDLCreateOption.class, objNm.getClass())) {
            Object[] paramArr = { paramInfo, ddlOption, objNm };
            Object obj = VartechReflectionUtils.invokeMethod(this.ddlScriptImpl, callMethodName, paramArr);
            return (T) obj;
        } else {
            throw new VarsqlMethodNotFoundException(String.format("MetaControlBean getDDLScript ->  %s method not found ", callMethodName));
        }
    } catch (Exception e) {
        logger.error("getDDLScript class : {} , callMethodName : {}, objArr : {}  ", this.ddlScriptImpl.getClass(), callMethodName, StringUtils.join(objNm));
        logger.error("getDDLScript callMethodName ", e);
    }
    return null;
}
Also used : VarsqlMethodNotFoundException(com.varsql.core.exception.VarsqlMethodNotFoundException) ServiceObject(com.varsql.core.db.valueobject.ServiceObject) DBMetadataException(com.varsql.core.exception.DBMetadataException) VarsqlMethodNotFoundException(com.varsql.core.exception.VarsqlMethodNotFoundException) SQLException(java.sql.SQLException)

Aggregations

ServiceObject (com.varsql.core.db.valueobject.ServiceObject)1 DBMetadataException (com.varsql.core.exception.DBMetadataException)1 VarsqlMethodNotFoundException (com.varsql.core.exception.VarsqlMethodNotFoundException)1 SQLException (java.sql.SQLException)1