Class GeneralUtils
- java.lang.Object
-
- org.teichert.databaseexplorer.utils.GeneralUtils
-
public final class GeneralUtils extends Object
This class contains some important methods to work with the main dataholding classes likeSQLTable
,SQLDatabase
etc. It also provides methods for loading theDatabaseModel
by reflection (including Plugin-based DatabaseModel-types)
handling the cache or providees
for executing parallel tasks and more.
-
-
Field Summary
Fields Modifier and Type Field Description static ExecutorService
es
This is used for executing the sqls of each editor
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
clearCache()
static SQLTable
combineTableInfos(SQLTable table1, SQLTable table2)
static SQLForeignInfo
convertForeignColumnToForeignInfo(SQLTableColumn tableFrom, SQLForeignColumn foreignColumn)
static Set<SQLTable>
getAllDependendTablesByDepth(int depthCount, SQLTable table, boolean onlyRealDependencys)
Gets all Tables dependend to the giventable
and all dependend tables of the depndencies themselfs.static Set<SQLTable>
getAllDirectDependendTables(SQLTable table, boolean onlyRealDependencys)
Gets all Tables dependend to the giventable
and all dependend tables of the depndencies themselfs.static List<SQLIndex>
getAllNonPrimaryIndexes(SQLTable table)
static List<DatabaseModel>
getDatabaseModels()
static List<Class<?>>
getDatabaseModelsClassList()
static List<DriverSetting>
getListOfDriverSettings()
static Class<? extends DatabaseModel>
getModelByName(String name)
static void
saveCache()
static void
updateCache(ISQLItem<?,?> item, boolean isDelete)
-
-
-
Field Detail
-
es
public static ExecutorService es
This is used for executing the sqls of each editor
-
-
Method Detail
-
getAllDependendTablesByDepth
public static Set<SQLTable> getAllDependendTablesByDepth(int depthCount, SQLTable table, boolean onlyRealDependencys)
Gets all Tables dependend to the giventable
and all dependend tables of the depndencies themselfs. So this method will recursifly loop through all dependencies restricted to the (max)-depthCount and collect the tables in a list and returns it. Also, you can choose if you include manually configured dependencys (configured over the gui) or not.- Parameters:
depthCount
-table
-onlyRealDependencys
-- Returns:
-
getAllDirectDependendTables
public static Set<SQLTable> getAllDirectDependendTables(SQLTable table, boolean onlyRealDependencys)
Gets all Tables dependend to the giventable
and all dependend tables of the depndencies themselfs. So this method will recursifly loop through all dependencies and collect the tables in a list and returns it. Also, you can choose if you include manually configured dependencys (configured over the gui) or not.- Parameters:
table
-onlyRealDependencys
-- Returns:
-
getListOfDriverSettings
public static List<DriverSetting> getListOfDriverSettings()
-
getDatabaseModelsClassList
public static List<Class<?>> getDatabaseModelsClassList() throws ClassNotFoundException, IOException, URISyntaxException
-
getModelByName
public static Class<? extends DatabaseModel> getModelByName(String name)
-
convertForeignColumnToForeignInfo
public static SQLForeignInfo convertForeignColumnToForeignInfo(SQLTableColumn tableFrom, SQLForeignColumn foreignColumn)
-
getDatabaseModels
public static List<DatabaseModel> getDatabaseModels()
-
saveCache
public static void saveCache() throws IOException
- Throws:
IOException
-
clearCache
public static void clearCache()
-
updateCache
public static void updateCache(ISQLItem<?,?> item, boolean isDelete)
-
-