本文整理匯總了Java中org.apache.ibatis.session.SqlSession.selectOne方法的典型用法代碼示例。如果您正苦於以下問題:Java SqlSession.selectOne方法的具體用法?Java SqlSession.selectOne怎麽用?Java SqlSession.selectOne使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.ibatis.session.SqlSession
的用法示例。
在下文中一共展示了SqlSession.selectOne方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: testCache2
import org.apache.ibatis.session.SqlSession; //導入方法依賴的package包/類
@Test
public void testCache2() {
SqlSession sqlSession = MybatisHelper.getSqlSession();
try {
//第一次查詢,會被緩存
sqlSession.selectOne("selectCache", 35);
//隻有close才會真正緩存,而不是用一級緩存
sqlSession.close();
//======================================================================
sqlSession = MybatisHelper.getSqlSession();
sqlSession.selectOne("selectCache", 35);
sqlSession.close();
} finally {
sqlSession.close();
}
}
示例2: selectArticleAbstract
import org.apache.ibatis.session.SqlSession; //導入方法依賴的package包/類
@Override
public Map selectArticleAbstract(String articleid) throws Exception {
SqlSession os = sqlSessionFactory.openSession();
Map articleTitle = os.selectOne("selectArticleAbstract", articleid);
os.close();
return articleTitle;
}
示例3: selectContentByClassifyid
import org.apache.ibatis.session.SqlSession; //導入方法依賴的package包/類
@Override
public Map selectContentByClassifyid(Map map2) throws Exception {
SqlSession os = sqlSessionFactory.openSession();
Map classifyContent = os.selectOne("selectContentByClassifyid", map2);
os.close();
return classifyContent;
}
示例4: selectAllcommentNotifiNum
import org.apache.ibatis.session.SqlSession; //導入方法依賴的package包/類
@Override
public int selectAllcommentNotifiNum(Map map) throws Exception {
SqlSession os = sqlSessionFactory.openSession();
Integer count = os.selectOne("selectAllcommentNotifiNum", map);
os.close();
return count;
}
示例5: selectArticleContent
import org.apache.ibatis.session.SqlSession; //導入方法依賴的package包/類
@Override
public String selectArticleContent(String articleid) throws Exception {
SqlSession os = sqlSessionFactory.openSession();
String articleDetail = os.selectOne("selectArticleContent", articleid);
os.close();
return articleDetail;
}
示例6: selectCollectNotifyByUserid
import org.apache.ibatis.session.SqlSession; //導入方法依賴的package包/類
@Override
public int selectCollectNotifyByUserid(String userid) throws Exception {
SqlSession os = sqlSessionFactory.openSession();
int i = os.selectOne("selectCollectNotifyByUserid", userid);
os.close();
return i;
}
示例7: selectUseridByTokenid
import org.apache.ibatis.session.SqlSession; //導入方法依賴的package包/類
@Override
public String selectUseridByTokenid(String token_id) {
SqlSession os = sqlSessionFactory.openSession();
String user_id = (String) os.selectOne("selectUseridByTokenid", token_id);
os.close();
return user_id;
}
示例8: selectUserByUserid
import org.apache.ibatis.session.SqlSession; //導入方法依賴的package包/類
@Override
public Userinfo selectUserByUserid(String userid) throws Exception {
SqlSession os = sqlSessionFactory.openSession();
Userinfo userinfo = os.selectOne("selectUserByUserid",userid);
os.close();
return userinfo;
}
示例9: selectPraiseByUseridAndPraiseUserid
import org.apache.ibatis.session.SqlSession; //導入方法依賴的package包/類
@Override
public int selectPraiseByUseridAndPraiseUserid(Map praiseMap) throws Exception {
SqlSession os = sqlSessionFactory.openSession();
int is_praise = os.selectOne("selectPraiseByUseridAndPraiseUserid", praiseMap);
os.close();
return is_praise;
}
示例10: get
import org.apache.ibatis.session.SqlSession; //導入方法依賴的package包/類
public ProblemUserEntity get(SqlSession sqlSession, ProblemUserEntity entity) {
return sqlSession.selectOne("problemUser.select", entity);
}
示例11: getTestCaseCountByPid
import org.apache.ibatis.session.SqlSession; //導入方法依賴的package包/類
public int getTestCaseCountByPid(SqlSession sqlsession,int pid){
return sqlsession.selectOne("testCases.getTestCaseCountByPid",pid);
}
示例12: getUserByUid
import org.apache.ibatis.session.SqlSession; //導入方法依賴的package包/類
public UserEntity getUserByUid(SqlSession session, int uid) {
return session.selectOne("user.selectUserByUid", uid);
}
示例13: get
import org.apache.ibatis.session.SqlSession; //導入方法依賴的package包/類
public ContestProblemUserEntity get(SqlSession sqlSession, ContestProblemUserEntity entity) {
return sqlSession.selectOne("contestProblemUser.select", entity);
}
示例14: getGroup
import org.apache.ibatis.session.SqlSession; //導入方法依賴的package包/類
public GroupEntity getGroup(SqlSession sqlSession,int gid){ ;
return sqlSession.selectOne("group.getGroup",gid);
}
示例15: getAttachment
import org.apache.ibatis.session.SqlSession; //導入方法依賴的package包/類
public AttachmentEntity getAttachment(SqlSession sqlSession, int aid) {
return sqlSession.selectOne("attachment.getAttachment", aid);
}