package org.project.neutrino.nfvo.catalogue.nfvo;

import org.project.neutrino.nfvo.catalogue.util.IdGenerator;

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

/**
 * Created by lto on 11/05/15.
 */
@Entity
public class NFVImage {
    @Id
    private String id = IdGenerator.createUUID();
    @Version
    private int version = 0;

    private String extId;
    private String name;
    private String minRam;
    private String minDiskSpace;
    private String minCPU;

    @Temporal(TemporalType.DATE)
    private Date created;

    public NFVImage() {
    }

    public String getName() {
        return name;
    }

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

    public String getId() {
        return id;
    }

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

    public int getVersion() {
        return version;
    }

    public void setVersion(int version) {
        this.version = version;
    }

    public String getExtId() {
        return extId;
    }

    public void setExtId(String extId) {
        this.extId = extId;
    }

    public String getMinRam() {
        return minRam;
    }

    public void setMinRam(String minRam) {
        this.minRam = minRam;
    }

    public String getMinDiskSpace() {
        return minDiskSpace;
    }

    public void setMinDiskSpace(String minDiskSpace) {
        this.minDiskSpace = minDiskSpace;
    }

    public String getMinCPU() {
        return minCPU;
    }

    public void setMinCPU(String minCPU) {
        this.minCPU = minCPU;
    }

    @Override
    public String toString() {
        return "Image{" +
                "id='" + id + '\'' +
                ", version=" + version +
                ", extId='" + extId + '\'' +
                ", minRam='" + minRam + '\'' +
                ", minDiskSpace='" + minDiskSpace + '\'' +
                ", minCPU='" + minCPU + '\'' +
                '}';
    }

    public void setCreated(Date created) {
        this.created = created;
    }

    public Date getCreated() {
        return created;
    }
}

@@ -389,30 +389,27 @@
     private 
-Str
 in
-g
+t
  minRam;%0A   
@@ -413,30 +413,27 @@
     private 
-Str
 in
-g
+t
  minDiskSpac
@@ -523,16 +523,76 @@
 eated;%0A%0A
+    @Temporal(TemporalType.DATE)%0A    private Date updated;%0A%0A
     publ
@@ -1147,30 +1147,27 @@
 %0A    public 
-Str
 in
-g
+t
  getMinRam()
@@ -1225,22 +1225,19 @@
 tMinRam(
-Str
 in
-g
+t
  minRam)
@@ -1283,30 +1283,27 @@
 %0A    public 
-Str
 in
-g
+t
  getMinDiskS
@@ -1379,22 +1379,19 @@
 skSpace(
-Str
 in
-g
+t
  minDisk
@@ -1586,24 +1586,288 @@
 CPU;%0A    %7D%0A%0A
+    public void setCreated(Date created) %7B%0A        this.created = created;%0A    %7D%0A%0A    public Date getCreated() %7B%0A        return created;%0A    %7D%0A%0A    public Date getUpdated() %7B return updated; %7D%0A%0A    public void setUpdated(Date updated) %7B this.updated = updated; %7D%0A%0A
     @Overrid
@@ -1954,32 +1954,75 @@
 %22 + id + '%5C'' +%0A
+                %22, name='%22 + name + '%5C'' +%0A
                 
@@ -2274,151 +2274,7 @@
    %7D
-%0A%0A    public void setCreated(Date created) %7B%0A        this.created = created;%0A    %7D%0A%0A    public Date getCreated() %7B%0A        return created;%0A    %7D
 %0A%7D%0A

change type of minRam and minDiskSpace to int; add value updated; add getter/setter; update toString()