package com.bitsofproof.supernode.model;

import java.io.Serializable;
import java.util.List;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table (name = "uns")
public class Unspent implements Serializable
{
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue
	private Long id;

	@ManyToOne (optional = false, fetch = FetchType.LAZY)
	private Blk upto;

	@OneToMany (fetch = FetchType.LAZY)
	private List<TxOut> outputs;

	public Long getId ()
	{
		return id;
	}

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

	public Blk getUpto ()
	{
		return upto;
	}

	public void setUpto (Blk upto)
	{
		this.upto = upto;
	}

	public List<TxOut> getOutputs ()
	{
		return outputs;
	}

	public void setOutputs (List<TxOut> outputs)
	{
		this.outputs = outputs;
	}

}

@@ -85,14 +85,46 @@
 til.
-List;%0A
+Set;%0A%0Aimport javax.persistence.Column;
 %0Aimp
@@ -294,43 +294,8 @@
 nyTo
-One;%0Aimport javax.persistence.OneTo
 Many
@@ -504,59 +504,60 @@
 %0A%0A%09@
-ManyToOne (optional = false, fetch = FetchType.LAZY
+Column (length = 64, nullable = false, unique = true
 )%0A%09p
@@ -563,19 +563,22 @@
 private 
-Blk
+String
  upto;%0A%0A
@@ -583,11 +583,12 @@
 %0A%0A%09@
-One
+Many
 ToMa
@@ -624,19 +624,18 @@
 private 
-Lis
+Se
 t%3CTxOut%3E
@@ -747,19 +747,22 @@
 %09public 
-Blk
+String
  getUpto
@@ -813,11 +813,14 @@
 to (
-Blk
+String
  upt
@@ -857,19 +857,18 @@
 %09public 
-Lis
+Se
 t%3CTxOut%3E
@@ -936,11 +936,10 @@
 ts (
-Lis
+Se
 t%3CTx

use hash