package com.huixinpn.dionysus.domain;

import org.hibernate.validator.constraints.NotEmpty;

import javax.persistence.*;
import java.util.Collection;

@Entity
@Table(name = "psychtestcategories")
public class PsychTestCategory {

  private static final long serialVersionUID = -4860066336043876229L;

  @NotEmpty
  @Column(name = "name", unique = true)
  private String name;

  @ManyToOne
  private Category parent;

  @OneToMany(mappedBy = "category")
  private Collection<PsychTest> tests;

  public PsychTestCategory() {
  }

  public String getName() {
    return name;
  }

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

  public Category getParent() {
    return parent;
  }

  public void setParent(Category parent) {
    this.parent = parent;
  }
}

@@ -114,16 +114,17 @@
 ence.*;%0A
+%0A
 import j
@@ -221,16 +221,52 @@
 ategory 
+extends AbstractDionysusPersistable 
 %7B%0A%0A  pri

update PsychTestCategory