Category.java :  » Media » m2engine » com » integrationpath » mengine » model » Java Open Source

Java Open Source » Media » m2engine 
m2engine » com » integrationpath » mengine » model » Category.java
package com.integrationpath.mengine.model;

// Generated Apr 2, 2009 11:32:43 AM by Hibernate Tools 3.2.2.GA

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Category generated by hbm2java
 * 
 * @author <a href="mailto:colaru@gmail.com">Cristian Olaru</a>
 */
@Entity
@Table(name = "category")
public class Category implements java.io.Serializable {

  private Integer id;
  private String name;
  private String description;
  private Set<Article> articles = new HashSet<Article>(0);

  public Category() {
  }

  public Category(String name, String description, Set<Article> articles) {
    this.name = name;
    this.description = description;
    this.articles = articles;
  }

  @Id
  @GeneratedValue(strategy = IDENTITY)
  @Column(name = "id", unique = true, nullable = false)
  public Integer getId() {
    return this.id;
  }

  public void setId(Integer id) {
    this.id = id;
  }

  @Column(name = "name", length = 500)
  public String getName() {
    return this.name;
  }

  public void setName(String name) {
    this.name = name;
  }

  @Column(name = "description")
  public String getDescription() {
    return description;
  }

  public void setDescription(String description) {
    this.description = description;
  }

  @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "category")
  public Set<Article> getArticles() {
    return this.articles;
  }

  public void setArticles(Set<Article> articles) {
    this.articles = articles;
  }

}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.