這篇文章主要講解了“weed3-2.6.四大接口盤點是什么”,文中的講解內容簡單清晰,易于學習與理解,下面請大家跟著小編的思路慢慢深入,一起來研究和學習“weed3-2.6.四大接口盤點是什么”吧!
源碼:https://github.com/noear/weed3 源碼:https://gitee.com/noear/weed3
這是后面重點詳解的接口,用于支持xml sql 和 annotation sql
UserDao ud = db.mapper(UserDao.calss); ud.getUser(12);
此處略(前面主要就講這個接口)
//執行存儲過程
db.call("user_get").set("_user_id",1).getMap();
//執行查詢過程(我暫時這么叫它)
db.call("select * from user where id=@user_id").set("@user_id",1).getMap();db.sql("select * from user where id=?",1).getMap();db.sql(..) 還有一個快捷版:db.exe(..)。相當于:db.sql(...).execute(); //批處理時,可快速寫增、刪、改動作 例:
db.exe("DELETE FROM test where a=1")
db.table(..).select(..) -> IQuery
db.call(..) -> IQuery
db.sql(..) -> IQuery
public interface IQuery extends ICacheController<IQuery> {
long getCount() throws SQLException;
Object getValue() throws SQLException;
<T> T getValue(T def) throws SQLException;
Variate getVariate() throws SQLException;
Variate getVariate(Act2<CacheUsing,Variate> cacheCondition) throws SQLException;
<T extends IBinder> T getItem(T model) throws SQLException;
<T extends IBinder> T getItem(T model, Act2<CacheUsing, T> cacheCondition) throws SQLException;
<T extends IBinder> List<T> getList(T model) throws SQLException;
<T extends IBinder> List<T> getList(T model, Act2<CacheUsing, List<T>> cacheCondition) throws SQLException;
<T> T getItem(Class<T> cls) throws SQLException;
<T> T getItem(Class<T> cls,Act2<CacheUsing, T> cacheCondition) throws SQLException;
<T> List<T> getList(Class<T> cls) throws SQLException;
<T> List<T> getList(Class<T> cls,Act2<CacheUsing, List<T>> cacheCondition) throws SQLException;
DataList getDataList() throws SQLException;
DataList getDataList(Act2<CacheUsing, DataList> cacheCondition) throws SQLException;
DataItem getDataItem() throws SQLException;
DataItem getDataItem(Act2<CacheUsing, DataItem> cacheCondition) throws SQLException;
List<Map<String,Object>> getMapList() throws SQLException;
Map<String,Object> getMap() throws SQLException;
<T> List<T> getArray(String column) throws SQLException;
<T> List<T> getArray(int columnIndex) throws SQLException;
}感謝各位的閱讀,以上就是“weed3-2.6.四大接口盤點是什么”的內容了,經過本文的學習后,相信大家對weed3-2.6.四大接口盤點是什么這一問題有了更深刻的體會,具體使用情況還需要大家實踐驗證。這里是億速云,小編將為大家推送更多相關知識點的文章,歡迎關注!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。