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
Nested ClassesModifier and TypeClassDescriptionstatic classRepresenting each tree node.static classPOJO dataset element as configured in dataset.xml.
(oracle mapping information also initialized according to mapping file and the "cols" tag.)static classData structure of s-tree configuration. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic List<?>buildForest(AnResultset rs, DatasetCfg.TreeSemantics treeSemtcs) Convert the result set to a forest.static AnResultsetstatic DatasetCfg.AnTreeNodeformatSemanticNode(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.TreeSemanticsgetTreeSemtcs(String sk) static voidprotected static voidload(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 AnResultsetloadDataset(String conn, String sk) static AnResultsetloadDataset(String conn, String sk, int page, int size, String... args) static AnResultsetloadDataset(String conn, String sk, String... args) static List<?>static List<?>Load semantic tree configured in dataset.xml.static voidparseConfigs(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:
SAXExceptionIOException
-
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:
IOExceptionSAXException
-
parseConfigs
-
dataset
public static AnResultset dataset(String conn, String sk, int page, int size, String... args) throws SQLException, io.odysz.transact.x.TransException - Throws:
SQLExceptionio.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:
SQLExceptionio.odysz.transact.x.TransException
-
loadDataset
public static AnResultset loadDataset(String conn, String sk) throws SQLException, io.odysz.transact.x.TransException - Throws:
SQLExceptionio.odysz.transact.x.TransException
-
loadDataset
public static AnResultset loadDataset(String conn, String sk, String... args) throws SQLException, io.odysz.transact.x.TransException - Throws:
SQLExceptionio.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:
SQLExceptionio.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:
SQLExceptionio.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:
SQLExceptionSemanticException- 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:
SemanticObjectof node- Throws:
SQLException
-