本文整理汇总了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);
}