package org.openbaton.catalogue.security;

import org.openbaton.catalogue.nfvo.Quota;
import org.openbaton.catalogue.util.IdGenerator;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.PrePersist;
import java.io.Serializable;

/**
 * Created by lto on 24/05/16.
 */
@Entity
public class Project implements Serializable {
  @Id private String id;

  @Column(unique = true)
  private String name;

  private Quota quota;

  public String getId() {
    return id;
  }

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

  public String getName() {
    return name;
  }

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

  @Override
  public String toString() {
    return "Project{" + "id='" + id + '\'' + ", name='" + name + '\'' + ", quota=" + quota + '}';
  }

  public Quota getQuota() {
    return quota;
  }

  public void setQuota(Quota quota) {
    this.quota = quota;
  }

  @PrePersist
  public void ensureId() {
    id = IdGenerator.createUUID();
  }
}

@@ -460,16 +460,47 @@
  name;%0A%0A
+  private String description;%0A%0A
   privat
@@ -793,16 +793,24 @@
 roject%7B%22
+%0A       
  + %22id='
@@ -814,68 +814,197 @@
 d='%22
- + id + '%5C'' + %22, name='%22 + name + '%5C'' + %22, quota=%22 + quota
+%0A        + id%0A        + '%5C''%0A        + %22, name='%22%0A        + name%0A        + '%5C''%0A        + %22, description='%22%0A        + description%0A        + '%5C''%0A        + %22, quota=%22%0A        + quota%0A       
  + '
@@ -1209,11 +1209,167 @@
 D();%0A  %7D
+%0A%0A  public String getDescription() %7B%0A    return description;%0A  %7D%0A%0A  public void setDescription(String description) %7B%0A    this.description = description;%0A  %7D
 %0A%7D%0A

add description to Project