Giter VIP home page Giter VIP logo

Comments (1)

TommyLemon avatar TommyLemon commented on September 1, 2024

问题答疑

1. 学习和使用 APIJSON 需要了解哪些相关的知识?

需要了解 MySQL/PostgreSQL 或其它数据库的安装、建表、记录数据写入,Java IDE(InteliJ IDEA 或 Eclipse) 的安装,JDBC 驱动的接入(maven 或 jar 依赖)
https://github.com/APIJSON/APIJSON-Demo/blob/master/APIJSON-Java-Server/APIJSONDemo/pom.xml

2. 接入不同数据库时,是否需要修改相关源码?

如果在业务项目(假设为 APIJSONDemo)则需要引入 maven/jar 依赖,并修改 DemoSQLConfig.java 的源码来配置数据库。
如果在 APIJSON 生成的 SQL 后出现不兼容该数据库 SQL 语法,则需要改 AbstractSQLConfig.java 的源码。

3. APIJSON 源码需要掌握到什么程度?

能够修改 APIJSONDemo 的源码,及 APIJSON AbstractSQLConfig.java 关于 JSON 转 SQL 的过程,可以参考用户写的源码解析
https://github.com/rainboy-learn/apijson-learn


例如对接 DB2 最主要的是部署数据库,接入对应的 JDBC 把它跑起来,可以使用最简单的 Demo 来修改
https://github.com/APIJSON/APIJSON-Demo/tree/master/APIJSON-Java-Server

AbstractSQLConfig.java 中 JSON 转 SQL 应该只需要把 分页 语法调整下就可以兼容低版本,
可以参考有个开发者贡献的 Oracle 分页语法(修改了 getSQL 和 getLimitString,使用 ROWNUM 和子查询)
Tencent/APIJSON@08a3125

AbstractSQLConfig.java 中 getQuote 为字段名引号,MySQL 用的是反引号 `id` , PostgreSQL/SQLServer/Oracle 都是双引号 "id",
如果字段名和数据库关键词没有冲突,可以直接 return ""; 即不使用引号,对于大部分数据库也都没问题。

from opensourcetalent.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.