<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          coody-edbc支持多數(shù)據(jù)源的輕量級 ORM 框架

          聯(lián)合創(chuàng)作 · 2023-09-30 01:59

          simple-edbc

          一個簡單易用的ORM框架。集成hibernate與mybatis部分特征于一身

          支持原生SQL語句、支持各種彈性裝載

          支持注解控制表名、字段名

          支持注解控制數(shù)據(jù)源與數(shù)據(jù)源繼承關(guān)系

          可配合Spring事物管理

          簡化模型與數(shù)據(jù)庫對應(yīng)關(guān)系,提供默認(rèn)駝峰與下劃線命名規(guī)則

          文檔地址:https://shimo.im/doc/Gd6NqYolg7wfEAHJ/

          注意事項:

          在系統(tǒng)開發(fā)中對于數(shù)據(jù)庫模型盡量不要使用基礎(chǔ)數(shù)據(jù)類型,所有的實體類需繼承BaseModel。文檔中灰色方法為不常用方法,紅色為常用方法。

          面向問題:

          1. 規(guī)避繁瑣的mapper關(guān)系
          2. 避免SQL語句誤操作
          3. 簡化繁瑣的語句
          4. 控制數(shù)據(jù)源
          5. 簡化事務(wù)管理

          一、 數(shù)據(jù)庫字段對應(yīng)說明

          1, 默認(rèn)數(shù)據(jù)表為反駝峰式命名,對象模型中字段與數(shù)據(jù)庫字段一致(如)。

          2, 當(dāng)數(shù)據(jù)庫表與模型不統(tǒng)一時,使用@Table("實際表名")在數(shù)據(jù)模型類上標(biāo)記即可

          3, 當(dāng)數(shù)據(jù)庫字段與模型不統(tǒng)一時,使用@Column("實際字段名")在數(shù)據(jù)模型字段上標(biāo)記即可

          二、 數(shù)據(jù)源控制

          1, 如對查詢實時要求較高,可在方法上面標(biāo)記DBSource注解強制操作指定庫

          2, DBSource注解對相同類內(nèi)部方法調(diào)用不生效。

          3, 如若使用其他數(shù)據(jù)源,可DBSource("dataSource001")在方法頭部用注解進(jìn)行設(shè)置

          4, 數(shù)據(jù)源控制有上下方法層級繼承關(guān)系。

          5, 當(dāng)存在上級數(shù)據(jù)源且指定當(dāng)前數(shù)據(jù)源場景下,優(yōu)先使用本級別數(shù)據(jù)源

           

          三、 條件控制器

          條件控制器Where是JDBC全局通用的控制條件模型。功能強大幾乎兼容所有條件。

           

          使用方案:

          Where where=new Where();
          
          where.set("type",1)
          
          .set("status",2)
          
          .set("channel","in",{"channel001","channel002"})
          
          .set("level",">=",30).set("userName","is not null");

           

          a) set(String, String, Object...)

          字段

          可空

          描述

          String

          Not Null

          字段名

          String

          Not Null

          條件符

          Object…

          Null

          參數(shù)值

          使用案例:

          Where where=new Where();
          
          where.set("status","in",1,2,3,4);
          
          
          
          Where where=new Where();
          
          where.set("status","not in",1,2,3,4);
          
          
          
          
          
          Where where=new Where();
          
          where.set("status","=",1);
          
          
          
          Where where=new Where();
          
          where.set("status","",1);
          
          
          
          Where where=new Where();
          
          where.set("status",">=",1);
          
          
          
          Where where=new Where();
          
          where.set("title","like","%admin%");
          

           

          字段

          可空

          描述

          String

          Not Null

          字段名

          Object

          Null

          參數(shù)值,當(dāng)次參數(shù)為數(shù)組或集合,默認(rèn)in操作

          b) set(String, Object)

          使用案例:

          Where where=new Where();
          
          where.set("status",new Integer[]{ 1,2,3,4}); //in操作
          
          
          
          Where where=new Where();
          
          where.set("status", 1); //等于操作
          


          四、 配置方式:

           
            
               
          
                    
          
                  
             
                
          
                      
                
          
                          
                
          
                        
          
                  
               
          
                  
               
          
              
            
          
              
          
          
            
             
          
          
          
                  
                
          
          
            
          
          
            
              
          
          
          
                  
             
          
          
            
          
          
          
          
            
          
          
            
          
          
            
          
          
             
          
          
              
          
          
              
          
          
             
          
          
            

          一、 版權(quán)所有

          作者:WebSOS

          反饋郵箱:[email protected]

           

          瀏覽 29
          點贊
          評論
          收藏
          分享

          手機掃一掃分享

          編輯 分享
          舉報
          評論
          圖片
          表情
          推薦
          點贊
          評論
          收藏
          分享

          手機掃一掃分享

          編輯 分享
          舉報
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  国产美国黄色毛片 | 色婷婷在线视频精品免费 | 天天干天天色天天 | 大地影视中文第二页官网 | 91靠比|