Class QueryGenerator
java.lang.Object
org.eclipse.lemminx.customservice.synapse.dataService.QueryGenerator
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanaddDriverToClassPath(String driverPath, String className) Add a DB driver to the class loaderstatic StringgenerateDSSQueries(QueryGenRequestParams requestParams) Generate resources and queries for data service based on a datasourcegetTableList(QueryGenRequestParams requestParams) Extract the tables in a datasourcestatic CheckDBDriverResponseParamsisDriverAvailableInClassPath(String className, String projectPath) Check whether a driver is available in the class pathstatic booleanmodifyDriverInClassPath(String addDriverPath, String removeDriverPath, String className) Modify a DB driver in the class pathstatic booleanremoveDriverFromClassPath(String driverPath) Remove a DB driver from the class path
-
Constructor Details
-
QueryGenerator
public QueryGenerator()
-
-
Method Details
-
generateDSSQueries
Generate resources and queries for data service based on a datasource- Parameters:
requestParams- datasource parameters object- Returns:
- dbs file content with resources and queries
-
getTableList
Extract the tables in a datasource- Parameters:
requestParams- datasource parameters object- Returns:
- List of tables that exist in the database
-
isDriverAvailableInClassPath
public static CheckDBDriverResponseParams isDriverAvailableInClassPath(String className, String projectPath) Check whether a driver is available in the class path- Parameters:
className- DB connector class name in the driverprojectPath- Absolute path of the project root directory- Returns:
- Whether the DB driver is available in the class path and if available the version and driver path
-
addDriverToClassPath
Add a DB driver to the class loader- Parameters:
driverPath- folder path of the DB driverclassName- DB connector class name in the driver- Returns:
- Whether the DB driver was successfully added to the class path
-
removeDriverFromClassPath
Remove a DB driver from the class path- Parameters:
driverPath- folder path of the DB driver- Returns:
- Whether the DB driver was successfully removed from the class path
-
modifyDriverInClassPath
public static boolean modifyDriverInClassPath(String addDriverPath, String removeDriverPath, String className) Modify a DB driver in the class path- Parameters:
addDriverPath- folder path of the DB driver to be addedremoveDriverPath- folder path of the DB driver to be removedclassName- DB connector class name in the driver- Returns:
- Whether the DB driver was modified successfully in the class path
-