⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 article.java

📁 java写的blog
💻 JAVA
字号:
/*
 * Created on 2004-8-22
 * Author: Xuefeng, Copyright (C) 2004, Xuefeng.
 */
package org.crystalblog.domain;

import java.util.Date;

import org.crystalblog.exception.ValidateException;

/**
 * Article.
 * 
 * @author Xuefeng
 */
public class Article implements Validator {

    private int categoryId; // foreign key
    private int accountId;  // foreign key

    private int articleId;  // primary key

    private String title;
    private String summary = "";
    private String content = "";
    private boolean visible = true;

    private Date createdDate;
    private Date updatedDate;

    // feedbacks count:
    private int feedbacks;

    // visits count:
    private int webVisits;
    private int rssVisits;

    public int getAccountId() { return accountId; }
    public void setAccountId(int accountId) { this.accountId = accountId; }

    public int getArticleId() { return articleId; }
    public void setArticleId(int articleId) { this.articleId = articleId; }

    public int getCategoryId() { return categoryId; }
    public void setCategoryId(int categoryId) { this.categoryId = categoryId; }

    public boolean getVisible() { return visible; }
    public void setVisible(boolean visible) { this.visible = visible; }

    public String getContent() { return content; }
    public void setContent(String content) { this.content = content; }

    public Date getCreatedDate() { return createdDate; }
    public void setCreatedDate(Date createdDate) {
        this.createdDate = createdDate;
        this.updatedDate = createdDate;
    }

    public int getFeedbacks() { return feedbacks; }
    public void setFeedbacks(int feedbacks) { this.feedbacks = feedbacks; }

    public int getRssVisits() { return rssVisits; }
    public void setRssVisits(int rssVisits) { this.rssVisits = rssVisits; }

    public String getSummary() { return summary; }
    public void setSummary(String summary) { this.summary = summary; }

    public String getTitle() { return title; }
    public void setTitle(String title) { this.title = title; }

    public Date getUpdatedDate() { return updatedDate; }
    public void setUpdatedDate(Date updatedDate) { this.updatedDate = updatedDate; }

    public int getWebVisits() { return webVisits; }
    public void setWebVisits(int webVisits) { this.webVisits = webVisits; }

    public void validate() throws ValidateException {
        if(title==null || title.equals(""))
            throw new ValidateException(INVALID_ARTICLE_TITLE);
        if(content==null)
            content="";
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -