Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

Weed3-2.4. What are the stored procedures and query procedures in

Shulou Source: shulou.com Published: 2022-06-02 10:44:38 10月03日 Update

This article shows you what the storage process and query process in weed3-2.4. are. The content is concise and easy to understand. It will definitely make your eyes shine. I hope you can gain something through the detailed introduction of this article.

Weed3 A Micro ORM Framework (Only 0.1Mb Oh)

Two schemes are designed for stored procedure support

1. Stored Procedure Calls to Docking Databases

db.call("user_get").set("_user_id",1).getMap();

SQL query procedure (I call it query procedure)

Looks a bit like mybatis SQL annotation code

//db.call ("SELECT * FROM user WHERE id=@{user_id}").set("user_id",1).getMap();

They can also be materialized (into a separate class)

Materialization is used to arrange data processing in other modules (or folders)

1. Materialization of stored procedures for docking databases

public class user_get extends DbStoredProcedure { public user_get() { super(DbConfig.test); call("user_get"); set("_userID", () -> userID); } public long userID;}user_get sp =new user_get();sp.userID=10;Map map = sp.caching(cache).getMap();//Add a cache incidentally

2. Materialization of query process

public class user_get2 extends DbQueryProcedure { public user_get2() { super(db); sql("select * from user where type=@{type} AND sex=@{sex}"); //This binding method took a long time to come up with (just don't want to reflect!) set("type", () -> type); set("sex", () -> sex); } public int type; public int sex;}//DbQueryProcedure provides the same interface as DbStoredProcedure user_get2 sp =new user_get2();sp.userID=10;Map map = sp.caching(cache).getMap(); the above content is weed3-2.4. What are the stored procedures and query procedures? Have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserves, please pay attention to the industry information channel.

Tags: Process query storage entity data content that is skills database knowledge same concise concise two code function writing only interface data processing Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia Linux Microsoft macOS Shulou Information