Search in sources :

Example 1 with SearchPost

use of net.jforum.search.SearchPost in project jforum2 by rafaelsteil.

the class GenericLuceneDAO method makePost.

private Post makePost(ResultSet rs) throws SQLException {
    Post p = new SearchPost();
    p.setId(rs.getInt("post_id"));
    p.setForumId(rs.getInt("forum_id"));
    p.setTopicId(rs.getInt("topic_id"));
    p.setUserId(rs.getInt("user_id"));
    p.setTime(new Date(rs.getTimestamp("post_time").getTime()));
    p.setText(this.readPostTextFromResultSet(rs));
    p.setBbCodeEnabled(rs.getInt("enable_bbcode") == 1);
    p.setSmiliesEnabled(rs.getInt("enable_smilies") == 1);
    String subject = rs.getString("post_subject");
    if (subject == null || subject.trim().length() == 0) {
        subject = rs.getString("topic_title");
    }
    p.setSubject(subject);
    return p;
}
Also used : Post(net.jforum.entities.Post) SearchPost(net.jforum.search.SearchPost) Date(java.util.Date) SearchPost(net.jforum.search.SearchPost)

Aggregations

Date (java.util.Date)1 Post (net.jforum.entities.Post)1 SearchPost (net.jforum.search.SearchPost)1