Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

Weed3-2.60. What is the inventory of the four interfaces?

Shulou Source: shulou.com Published: 2022-06-02 03:41:54 09月25日 Update

This article mainly explains "weed3-2.6. what is the inventory of the four interfaces". The explanation in the article is simple and clear and easy to learn and understand. now please follow the editor's train of thought to study and learn "weed3-2.6. what is the inventory of the four interfaces?"

Weed3 A miniature ORM framework

Source code: https://github.com/noear/weed3 source code: https://gitee.com/noear/weed3

1. Mapper () execution: get the mapping agent

This is the interface that will be explained in more detail later, to support xml sql and annotation sql.

UserDao ud = db.mapper (UserDao.calss); ud.getUser (12); II. Table () execution: chain ORM operation

Here is a little bit (this interface is mainly talked about earlier)

3. Call (..) Execute: stored procedure or query procedure / execute stored procedure db.call ("user_get"). Set ("_ user_id", 1). GetMap (); / execute query procedure (as I temporarily call it) db.call ("select * from user where id=@user_id"). Set ("@ user_id", 1) .getMap (); IV, sql (..) Execute: SQL statement db.sql ("select * from user where id=?", 1) .getMap ()

Db.sql (..) There is also an express version: db.exe (..). Equivalent to: db.sql (...). Execute (); / / when batch processing, you can quickly write add, delete, and change actions example: db.exe ("DELETE FROM test where aplomb 1")

Unified return: IQuery (ensures the unity of the experience)

Db.table (..) .select (..)-> IQuery

Db.call (..)-> IQuery

Db.sql (..)-> IQuery

Public interface IQuery extends ICacheController {long getCount () throws SQLException; Object getValue () throws SQLException; T getValue (T def) throws SQLException; Variate getVariate () throws SQLException; Variate getVariate (Act2 cacheCondition) throws SQLException; T getItem (T model) throws SQLException; T getItem (T model, Act2 cacheCondition) throws SQLException; List getList (T model) throws SQLException; List getList (T model, Act2 cacheCondition) throws SQLException; T getItem (Class cls) throws SQLException T getItem (Class cls,Act2 cacheCondition) throws SQLException; List getList (Class cls) throws SQLException; List getList (Class cls,Act2 cacheCondition) throws SQLException; DataList getDataList () throws SQLException; DataList getDataList (Act2 cacheCondition) throws SQLException; DataItem getDataItem () throws SQLException; DataItem getDataItem (Act2 cacheCondition) throws SQLException; List getMapList () throws SQLException; Map getMap () throws SQLException; List getArray (String column) throws SQLException; List getArray (int columnIndex) throws SQLException Thank you for your reading. This is weed3-2.6a. What is the inventory of the four major interfaces? after the study of this article, I believe that you are interested in weed3-2.6. The question of what is the inventory of the four major interfaces has a deeper understanding, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Tags: Interface inventory process learning content source code storage query unification action that is ideas situations articles more framework knowledge knowledge points articles unity Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno vpn OPPO Reno Xiaomi Linux Shulou Technology