WEB开发网
开发学院软件开发Java 使用SpringSide 3.1.4.3开发Web项目的全过程(上)... 阅读

使用SpringSide 3.1.4.3开发Web项目的全过程(上)

 2009-09-24 00:00:00 来源:WEB开发网   
核心提示: Comment.java如下:packagepersonal.youxia.entity.entities;importjavax.persistence.Column;importjavax.persistence.Entity;importjavax.persistence.Table;im

Comment.java如下:

package personal.youxia.entity.entities;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import personal.youxia.entity.IdEntity;
@Entity
// 表名与类名不相同时重新定义表名.
@Table(name = "comments")
// 默认的缓存策略.
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class Comment extends IdEntity {
    private String content;
    private Long articleId;
    public String getContent() {
        return content;
    }
    public void setContent(String content) {
        this.content = content;
    }
    
    @Column(name = "article_id")
    public Long getArticleId() {
        return articleId;
    }
    public void setArticleId(Long articleId) {
        this.articleId = articleId;
    }
}

编写Dao层代码,ArticleDao.java如下:

package personal.youxia.dao;
import org.springside.modules.orm.hibernate.HibernateDao;
import personal.youxia.entity.Article;
public class ArticleDao extends HibernateDao<Article, Long> {
}

上一页  3 4 5 6 7 8 9 10  下一页

Tags:使用 SpringSide 开发

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接