Package io.odysz.semantic.DA
Class DatasetCfg
java.lang.Object
io.odysz.semantic.DA.DatasetCfg
Configured dataset.xml manager and helper.
- won't care using CP data source or DB manager (2019.2.28).
- won't care using CP data source or DB manager (2019.2.28).
- Author:
- odys-z@github.com
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Representing each tree node.static class
POJO dataset element as configured in dataset.xml.
(oracle mapping information also initialized according to mapping file and the "cols" tag.)static class
Data structure of s-tree configuration. -
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic List<?>
buildForest
(AnResultset rs, DatasetCfg.TreeSemantics treeSemtcs) Convert the result set to a forest.static AnResultset
static DatasetCfg.AnTreeNode
formatSemanticNode
(DatasetCfg.TreeSemantics treeSmx, AnResultset rs, int level) Create a SemanticObject for tree node with current rs row.
TODO should this moved to TreeSemantics?static DatasetCfg.TreeSemantics
getTreeSemtcs
(String sk) static void
protected static void
load
(HashMap<String, DatasetCfg.Dataset> cfgs, String xmlPath) Load all dataset.xml into the argument cfgs.
When return, cfgs is loaded with dataset configurations like [id, mysql:sql, orcl:sql, ...].static AnResultset
loadDataset
(String conn, String sk) static AnResultset
loadDataset
(String conn, String sk, int page, int size, String... args) static AnResultset
loadDataset
(String conn, String sk, String... args) static List<?>
static List<?>
Load semantic tree configured in dataset.xml.static void
parseConfigs
(HashMap<String, DatasetCfg.Dataset> cfgs, XMLTable xSmtcs) sks()
-
Field Details
-
ixMysql
public static final int ixMysql- See Also:
-
ixOrcl
public static final int ixOrcl- See Also:
-
ixMs2k
public static final int ixMs2k- See Also:
-
ixSqlit
public static final int ixSqlit- See Also:
-
ixUnknow
public static final int ixUnknow- See Also:
-
tag
- See Also:
-
cfgFile
- See Also:
-
deftId
- See Also:
-
dss
-
-
Constructor Details
-
DatasetCfg
public DatasetCfg()
-
-
Method Details
-
init
- Throws:
SAXException
IOException
-
sks
-
load
protected static void load(HashMap<String, DatasetCfg.Dataset> cfgs, String xmlPath) throws SAXException, IOExceptionLoad all dataset.xml into the argument cfgs.
When return, cfgs is loaded with dataset configurations like [id, mysql:sql, orcl:sql, ...].- Parameters:
cfgs
-xmlPath
-- Throws:
IOException
SAXException
-
parseConfigs
-
dataset
public static AnResultset dataset(String conn, String sk, int page, int size, String... args) throws SQLException, io.odysz.transact.x.TransException - Throws:
SQLException
io.odysz.transact.x.TransException
-
getTreeSemtcs
-
loadDataset
public static AnResultset loadDataset(String conn, String sk, int page, int size, String... args) throws SQLException, io.odysz.transact.x.TransException - Throws:
SQLException
io.odysz.transact.x.TransException
-
loadDataset
public static AnResultset loadDataset(String conn, String sk) throws SQLException, io.odysz.transact.x.TransException - Throws:
SQLException
io.odysz.transact.x.TransException
-
loadDataset
public static AnResultset loadDataset(String conn, String sk, String... args) throws SQLException, io.odysz.transact.x.TransException - Throws:
SQLException
io.odysz.transact.x.TransException
-
loadStree
public static List<?> loadStree(String conn, String sk, int page, int size, String... args) throws SQLException, io.odysz.transact.x.TransException - Throws:
SQLException
io.odysz.transact.x.TransException
-
loadStree
public static List<?> loadStree(String conn, String sk, io.odysz.transact.sql.PageInf page) throws SQLException, io.odysz.transact.x.TransException Load semantic tree configured in dataset.xml.- Parameters:
conn
-sk
-page
- cannot be null- Returns:
- forest
- Throws:
SQLException
io.odysz.transact.x.TransException
-
buildForest
public static List<?> buildForest(AnResultset rs, DatasetCfg.TreeSemantics treeSemtcs) throws SQLException, SemanticException Convert the result set to a forest.- Parameters:
rs
-treeSemtcs
-- Returns:
- built forest
- Throws:
SQLException
SemanticException
- data structure can not build tree / forest
-
formatSemanticNode
public static DatasetCfg.AnTreeNode formatSemanticNode(DatasetCfg.TreeSemantics treeSmx, AnResultset rs, int level) throws SQLException Create a SemanticObject for tree node with current rs row.
TODO should this moved to TreeSemantics?- Parameters:
treeSmx
-rs
-level
- depth of this node- Returns:
SemanticObject
of node- Throws:
SQLException
-