File tree Expand file tree Collapse file tree 2 files changed +46
-0
lines changed Expand file tree Collapse file tree 2 files changed +46
-0
lines changed Original file line number Diff line number Diff line change 88 branches : [ main ]
99 paths :
1010 - godel-script/**
11+ workflow_dispatch :
1112
1213jobs :
1314 mac-aarch64-build :
4748 run : |
4849 git config --global user.name "$(git log -n 1 --pretty=format:%an)"
4950 git config --global user.email "$(git log -n 1 --pretty=format:%ae)"
51+ - name : Install Package
52+ run : |
53+ apt-get install sqlite3 libsqlite3-dev
5054 - name : Build
5155 run : |
5256 cd godel-script
Original file line number Diff line number Diff line change 1+ // script
2+ use coref::java::*
3+ use coref::xml::*
4+
5+ fn default_xml_db() -> XmlDB { return XmlDB::load("coref_xml_src.db") }
6+ fn default_java_db() -> JavaDB { return JavaDB::load("coref_java_src.db") }
7+
8+ schema DBElement extends XmlElement {}
9+
10+ impl DBElement {
11+ // find XmlElement with name "resultMap"
12+ pub fn __all__(db: XmlDB) -> *Self {
13+ for (x in XmlElement(db)) {
14+ if (x.getElementName() = "resultMap") {
15+ yield DBElement { ..x }
16+ }
17+ }
18+ }
19+
20+ // get attribute "type" from XmlElement "resultMap"
21+ pub fn getType(self) -> string {
22+ for (a in self.getAttribute()) {
23+ if (a.getName() = "type") {
24+ return a.getValue()
25+ }
26+ }
27+ }
28+ }
29+
30+ // if DBElement's type name equals to Java Class name, then collect this Class info
31+ fn getDOClassFromResultMap() -> *Class {
32+ for (c in Class(default_java_db()), e in DBElement(default_xml_db())) {
33+ if (c.getQualifiedName() = e.getType()) {
34+ yield c
35+ }
36+ }
37+ }
38+
39+ // example query, just get the class name, you could do other queries
40+ query do_class
41+ from c in getDOClassFromResultMap()
42+ select c.getQualifiedName() as do_class_name
You can’t perform that action at this time.
0 commit comments