Search in sources :

Example 1 with MetaControlBean

use of com.varsql.core.db.MetaControlBean in project varsql by varsqlinfo.

the class ExportServiceImpl method selectExportTableInfo.

/**
 * @Method Name  : selectExportTableInfo
 * @Method 설명 : table export list
 * @작성자   : ytkim
 * @작성일   : 2019. 4. 29.
 * @변경이력  :
 * @param preferencesInfo
 * @return
 * @throws Exception
 */
public ResponseResult selectExportTableInfo(PreferencesRequestDTO preferencesInfo) throws Exception {
    MetaControlBean dbMetaEnum = MetaControlFactory.getDbInstanceFactory(preferencesInfo.getDbType());
    ResponseResult result = new ResponseResult();
    result.setItemList(dbMetaEnum.getDBObjectList(ObjectType.TABLE.getObjectTypeId(), preferencesInfo));
    return result;
}
Also used : ResponseResult(com.vartech.common.app.beans.ResponseResult) MetaControlBean(com.varsql.core.db.MetaControlBean)

Example 2 with MetaControlBean

use of com.varsql.core.db.MetaControlBean in project varsql by varsqlinfo.

the class DatabaseServiceImpl method createDDL.

/**
 * @Method Name  : createDDL
 * @Method 설명 : 생성 스크립트.
 * @작성자   : ytkim
 * @작성일   : 2017. 11. 16.
 * @변경이력  :
 * @param databaseParamInfo
 * @return
 */
public ResponseResult createDDL(DatabaseParamInfo databaseParamInfo) {
    MetaControlBean dbMetaEnum = MetaControlFactory.getDbInstanceFactory(databaseParamInfo.getDbType());
    ResponseResult result = new ResponseResult();
    try {
        result.setItemOne(dbMetaEnum.getDDLScript(ObjectType.getDBObjectType(databaseParamInfo.getObjectType()).getObjectTypeId(), databaseParamInfo, databaseParamInfo.getObjectName()));
    } catch (Exception e) {
        logger.error("createDDL : ", e);
    }
    return result;
}
Also used : ResponseResult(com.vartech.common.app.beans.ResponseResult) MetaControlBean(com.varsql.core.db.MetaControlBean) SQLException(java.sql.SQLException) DBMetadataException(com.varsql.core.exception.DBMetadataException)

Example 3 with MetaControlBean

use of com.varsql.core.db.MetaControlBean in project varsql by varsqlinfo.

the class DatabaseServiceImpl method serviceMenu.

/**
 * @Method Name  : serviceMenu
 * @Method 설명 : 메뉴 정보보기
 * @작성자   : ytkim
 * @작성일   : 2015. 4. 10.
 * @변경이력  :
 * @param databaseParamInfo
 * @return
 * @throws Exception
 */
public ResponseResult serviceMenu(DatabaseParamInfo databaseParamInfo) {
    ResponseResult result = new ResponseResult();
    MetaControlBean dbMetaEnum = MetaControlFactory.getDbInstanceFactory(databaseParamInfo.getDbType());
    result.setItemList(dbMetaEnum.getServiceMenu());
    return result;
}
Also used : ResponseResult(com.vartech.common.app.beans.ResponseResult) MetaControlBean(com.varsql.core.db.MetaControlBean)

Example 4 with MetaControlBean

use of com.varsql.core.db.MetaControlBean in project varsql by varsqlinfo.

the class DatabaseServiceImpl method schemas.

/**
 * @Method Name  : schemas
 * @Method 설명 : 스키마 정보보기
 * @작성일   : 2015. 4. 10.
 * @작성자   : ytkim
 * @변경이력  :
 * @param databaseParamInfo
 * @return
 * @throws SQLException
 * @throws Exception
 */
public Map schemas(DatabaseParamInfo databaseParamInfo) throws SQLException {
    Map json = new HashMap();
    DatabaseInfo dbinfo = SecurityUtil.userDBInfo(databaseParamInfo.getConuid());
    MetaControlBean dbMetaEnum = MetaControlFactory.getDbInstanceFactory(dbinfo.getType());
    json.put("schema", dbinfo.getSchema());
    json.put("conuid", dbinfo.getConnUUID());
    json.put("type", dbinfo.getType());
    json.put("lazyload", dbinfo.isLazyLoad());
    json.put("schemaList", dbMetaEnum.getSchemas(databaseParamInfo));
    json.put("serviceObject", dbMetaEnum.getServiceMenu());
    return json;
}
Also used : HashMap(java.util.HashMap) DatabaseInfo(com.varsql.core.db.valueobject.DatabaseInfo) MetaControlBean(com.varsql.core.db.MetaControlBean) HashMap(java.util.HashMap) Map(java.util.Map)

Example 5 with MetaControlBean

use of com.varsql.core.db.MetaControlBean in project varsql by varsqlinfo.

the class DatabaseServiceImpl method dbObjectMetadataList.

/**
 * @Method Name  : dbObjectMetadataList
 * @Method 설명 : meta 정보 보기.
 * @작성자   : ytkim
 * @작성일   : 2017. 11. 16.
 * @변경이력  :
 * @param databaseParamInfo
 * @return
 */
public ResponseResult dbObjectMetadataList(DatabaseParamInfo databaseParamInfo) {
    MetaControlBean dbMetaEnum = MetaControlFactory.getDbInstanceFactory(databaseParamInfo.getDbType());
    ResponseResult result = new ResponseResult();
    try {
        result.setItemList(dbMetaEnum.getDBObjectMeta(ObjectType.getDBObjectType(databaseParamInfo.getObjectType()).getObjectTypeId(), databaseParamInfo, databaseParamInfo.getObjectName()));
    } catch (Exception e) {
        logger.error("dbObjectMetadataList : {} ", e.getMessage(), e);
    }
    return result;
}
Also used : ResponseResult(com.vartech.common.app.beans.ResponseResult) MetaControlBean(com.varsql.core.db.MetaControlBean) SQLException(java.sql.SQLException) DBMetadataException(com.varsql.core.exception.DBMetadataException)

Aggregations

MetaControlBean (com.varsql.core.db.MetaControlBean)12 ResponseResult (com.vartech.common.app.beans.ResponseResult)10 DBMetadataException (com.varsql.core.exception.DBMetadataException)4 SQLException (java.sql.SQLException)4 HashMap (java.util.HashMap)3 Map (java.util.Map)3 DatabaseInfo (com.varsql.core.db.valueobject.DatabaseInfo)2 DatabaseParamInfo (com.varsql.core.db.valueobject.DatabaseParamInfo)2 DDLCreateOption (com.varsql.core.db.valueobject.ddl.DDLCreateOption)2 DBConnectionEntity (com.varsql.web.model.entity.db.DBConnectionEntity)2 EnumMapperValue (com.vartech.common.app.beans.EnumMapperValue)2 ModelMap (org.springframework.ui.ModelMap)2 ProgressInfo (com.varsql.core.common.beans.ProgressInfo)1 VarsqlFileType (com.varsql.core.common.code.VarsqlFileType)1 BlankConstants (com.varsql.core.common.constants.BlankConstants)1 VarsqlConstants (com.varsql.core.common.constants.VarsqlConstants)1 SecurityUtil (com.varsql.core.common.util.SecurityUtil)1 SQLWriter (com.varsql.core.data.writer.SQLWriter)1 DBType (com.varsql.core.db.DBType)1 MetaControlFactory (com.varsql.core.db.MetaControlFactory)1