準備公升級新問答系統dao層(ibatis->mybatis),
寫乙個spring+mybatis+tddl的demo作為準備,特此記錄
org.mybatis
mybatis$
org.mybatis
mybatis-spring
$
com.taobao.tddltddl-client
2.4.4.1
com.taobao.tddl
tddl-sequence
2.4.3
com.taobao.diamond
diamond-client
3.0.4
關於 spring 外掛程式:
spring外掛程式的開發,mybatis官方有一段說明,大意是mybatis 3發布之前,spring 3的開發已經結束了,spring團隊不願意與沒有正式發布的第三方整合(比較謹慎啊),因此mybatis官方決定自己開發,詳見
1:domain的包路徑和
路徑 的配置可以自動掃瞄,避免手動維護.
2:掃瞄介面類
package org.xiuyuan.mybatis.demo.dao;
import org.apache.ibatis.annotations.param;
import org.xiuyuan.mybatis.demo.domain.buythreaddo;
/** * created with intellij idea.
* user: yijun.zyj
* date: 13-6-21
*/public inte***ce buythreaddao
<?xml version="1.0" encoding="utf-8"?>t.reply_count, t.options, t.author_id, t.author_nick, t.author_ip,
t.last_reply_author_id, t.last_reply_author_nick, t.type_path,
t.last_reply_id, t.last_reply_time, t.last_modified, t.security_status,
t.security_operator_id, t.security_operation_time, t.notification_type,
t.claim_time, t.claim_status, t.best_reply_id, t.best_user_id, t.best_user_nick,
t.best_finish_date, t.best_reply_abstract, t.best_status, t.best_srp_content,
t.image_url, t.tag, t.audit_state, t.audit_time, t.audit_user_id, t.audit_user_nick,
t.tcp_audit_state, t.tcp_audit_time, t.tcp_auditor,
t.gmt_create, t.gmt_modified, t.recommend_state,t.anonymous_state
select from tba_buy_thread t
where t.id = #
and t.deleted = 0 and t.tcp_audit_state = 0
update tba_buy_thread t
sett.deleted = 1,
t.gmt_modified = current_timestamp
where t.id = #
update tba_buy_thread t
sett.deleted = 1,
t.security_operator_id = #,
t.security_operation_time = current_timestamp,
t.gmt_modified = current_timestamp
where t.id = #
update tba_buy_thread t
sett.deleted = 0,
t.tcp_audit_state = 0,
t.gmt_modified = current_timestamp
where t.id = #
1: parametertype可以通過之前的別名(
typealiasespackage
)配置自動識別.
2: 開啟mapunderscoretocamelcase引數,mybatis自動將下劃線的命名格式轉換為駝峰命名,如表欄位名
create_time,在domain類中定義為
createtime,執行sql語句後,mybatis會自動把create_time轉換為createtime,省去了寫sql時指定別名的麻煩。
package org.xiuyuan.mybatis.demo.dao;
//ingore import
/** * created with intellij idea.
* user: yijun.zyj
* date: 13-6-21
* to change this template use file | settings | file templates.
*/@runwith(springjunit4classrunner.class)
@contextconfiguration(locations = )
public class buythreaddaotest
@test
public void testnextid()
@test
public void createbuythreadtest()
long nextid = basedaoutil.nextbuythreadid();
buythreaddo.setid(nextid);
buythreaddo.setsubject(buythreaddo.getsubject() + "-222");
buythreaddao.createbuythread(buythreaddo);
} }
python知識點智慧型問答 智慧型問答
自從 一行python 實現夸夸聊天機械人 發布後,有不少同學期待著夸夸聊天機械人的公升級。但是巧婦難為無公尺之炊,所以我準備了夸夸語料庫 為了夸夸聊天機械人,爬了乙份夸夸語料庫 有了夸夸問答語料之後,針對聊天機械人或者智慧型問答就有很多方法可以操作,最直接的乙個想法就是計算問題與夸夸語料庫中的標題...
CSDP認證問答
11月25日 正確方法管理軟體工程的親身體驗會 背景介紹 www.csdp.com.cn 1 csdp認證是哪個行業的認證?它與國內其他認證有什麼不同?答 csdp是it領域更確切的說是計算機軟體行業的職業認證。csdp英文全稱為certified software development prof...
CVS 使用問答
1,執行新增命令出錯?重現錯誤 執行命令 cvs add mydir cvs add in directory cvs add aborted there is no version here do cvs checkout first 環境變數 echo cvsroot pserver hover...