Mybatis one-to-many, one-to-one code generator

This is a GraphQL-like syntax + simple SQL syntax parser + code generator

The syntax parser is generated using PEGjs

Code generators support generation

  • mapper
  • resultMapper
  • model
  • select

Online experience

Youngboyvip. Gitee. IO/youngboy/my…

rendering

Syntax examples

var parser = require('graphql');

var query = ` select findByRootIdOrClassId(type:"com.fawkes.yhsw.common.model.TplClass") { b.id Long, b.class_name:className String, b.p_name:pName String, c.rootId Long, components.config(type:"com.fawkes.yhsw.common.model.TemplateModuleInfo",fetch:"list"){ a.id Long, a.component:component String, a.name String, a.page_type:pageType String, a.thumbnail String, a.range_index:rangeIndex Integer } } from tpl_class_info b JOIN tpl_class_rel c ON b.id = c.classId JOIN template_module_info a ON a.id = c.modId `;

var ast = parser.parse(query);
// ast is a plain JS object
Copy the code