<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                Minidao 快速集成(springmvc) === 第一步: 引入minidao 依賴 ``` <dependency> <groupId>org.jeecgframework</groupId> <artifactId>minidao-pe</artifactId> <version>1.8.5</version> </dependency> ``` 第二步: spring配置文件, 注冊MiniDao動態代理類 ``` <!-- MiniDao動態代理類 --> <bean id="miniDaoHandler" class="org.jeecgframework.minidao.factory.MiniDaoBeanScannerConfigurer"> <!-- 是使用什么字母做關鍵字Map的關鍵字 默認值origin 即和sql保持一致,lower小寫(推薦),upper 大寫 --> <property name="keyType" value="lower"></property> <!-- 格式化sql --> <property name="formatSql" value="false"></property> <!-- 輸出sql --> <property name="showSql" value="false"></property> <!-- 數據庫類型 最新版不需要了 <property name="dbType" value="mysql"></property> --> <!-- dao 掃描地址,配置符合spring方式 --> <property name="basePackage" value="examples.dao.*"></property> <!-- 使用的注解,默認是Minidao,推薦 Repository--> <property name="annotation" value="org.springframework.stereotype.Repository"></property> </bean> ``` 第三步: spring配置文件,注冊minidao需要使用的工具類 ``` <!-- JDBC配置 --> <bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate"> <property name="dataSource"> <ref bean="dataSource" /> </property> </bean> <!-- JDBC 占位符配置 --> <bean id="namedParameterJdbcTemplate" class="org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate"> <constructor-arg ref="dataSource" /> </bean> ``` 通過以上配置minidao集成OK,可以寫第一個Mini DA0 SQL了。 ### 測試代碼: [1]. 定義接口 DAO src/main/java/examples/dao/EmployeeDao.java ``` @Repository public interface EmployeeDao { /** * 查詢返回Java對象 【注解SQL】 * @param id * @return */ @Sql("select * from employee where id = :id") Employee get(@Param("id") String id); /** * 插入數據 【SQL文件】 * @param employee */ void insert(@Param("employee") Employee employee); } ``` [2]. 定義接口對應SQL src/main/resources/examples/sql/EmployeeDao_insert.sql ``` INSERT INTO employee ( id ,empno ,NAME ,AGE ,BIRTHDAY ,SALARY ,create_by ,create_date ,update_by ,update_date ) values ( :employee.id ,:employee.empno ,:employee.name ,:employee.age ,:employee.birthday ,:employee.salary ,:employee.createBy ,:employee.createDate ,:employee.updateBy ,:employee.updateDate ) ``` 更多示例源碼,請參考 [minidao-pe-example](https://github.com/zhangdaiscott/MiniDao)
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看