@Test public void testGetForum(){ jdbcTemplate.execute(" insert into t_forum(forum_name,forum_desc) "+ " values('test','test')"); int forumId = jdbcTemplate.queryForObject("select max(forum_id) from t_forum",Integer.class); Forum forum = forumDao.getForum(forumId); System.out.println(forum.getForumName()); }
public Forum getForum(int forumId){ return forumQuery.findObject(forumId); }
ForumOODao { public Forum getForum(int forumId){ return forumQuery.findObject(forumId); } }
ForumOODao { public Forum getForum(int forumId){ return forumQuery.findObject(forumId); }  }
ForumOODao { public Forum getForum(int forumId){ return forumQuery.findObject(forumId); }  @Autowired void setDataSource(DataSource dataSource); @PostConstruct void init(); Forum getForum(int forumId); void addForum(Forum forum); int getTopicNum(int userId); int getForumNum(); }
ForumOODao { public Forum getForum(int forumId){ return forumQuery.findObject(forumId); }  @Autowired void setDataSource(DataSource dataSource); @PostConstruct void init(); Forum getForum(int forumId); void addForum(Forum forum); int getTopicNum(int userId); int getForumNum();  }